Use a .VB file in addition to Code Behind

HardCode

Freshman
Joined
Apr 2, 2004
Messages
49
Let's say that I have a page stats.aspx that uses stats.vb as the code behind page. Now, assume that I have a .VB file that contains a class that will return an ADO.NET Connection Object that I want to be used in all code behind pages that access the database. Say it is called Conn.vb. How would I allow stats.vb to use/recognize the class(es) in the file Conn.vb? Can I even do this, or must I make Conn.vb into a DLL instead so I can use the Imports?
 
If you made the file into a DLL then you could share the single binary amongst several projects, otherwise just add the Conn.vb file to the current project and it will be usable.
 
I am not doing it through VS.NET using a Web Application. I am just creating the files in Web Matrix and putting them into the wwwroot directory. Would this make a difference since nothing is "binding" the files together except for their presence in the same directory (../wwwroot/mypages/Conn.vb)?
 
Back
Top