Thank you PeOfEo for your help.Actually only the second worked(Response.WriteFile(("Yourfile.inc")) which was what I needed in my question. But I need to include a connection file but the #include doesn't work, although it's written in msdn. The compiler doesn't recognise the varaible I use in the included file. Any suggestions? Or, can you tell me how make it a class and import it if the include doesn't work?
You can't use an include to get variables or scripts. It will not work, the server will parse in the content in the file b eing included but not execute it. Also, using an include tag within a <script> or <% code block %> will fail because they cannot be inside of them.
would be your only solution. If you want to call an external scripts you can use an external class, a code behind, or using script src