I am trying to include a subroutine in my aspx file, but when I do it shows up in the screen output. I have a sub and end sub as the first and last lines in the script, and I put the include statement near the top of the file. (See below)
<%@dotnet.itags.org. Page Language="VBScript" Debug="true" %>
<%@dotnet.itags.org. Import Namespace="System.IO" %>
<%@dotnet.itags.org. Import Namespace="System.Data.OleDb" %>
<!--#include file="Get_Database_value.vbs"-->
<script runat="server">
Sub Page_Load
Response.Write ("Nothing")
End Sub
</script>
If I try to put the include inside the script directives it flags that as an error. I have read how includes could be used for headers and footers, but for that you put the includes inside the <html> </html> tags. I am coming from an asp background where I just included the file with vb code at the top of the asp page and it worked fine. I have read some things about the configuration file and how you can put compiled code in subdirectories, but right now I just want to get it to work.
Thanks for any help
Fred Rodriguez
Hi,
I believe it is not the right way to attached a script file. At ASP.NET you can put all your code/classes under App_Code folder in the root directory of your code. And normally classes in ASP.Net 2.0 uses .vb extension.
I suggest you change your Get_Database_value.vbs into a .net 2.0 format and put it under App_Code. If your using Visual Studio Express it's very easy to add App_Code folder.
Cheers...
0 comments:
Post a Comment