I'm moving some of my code from ASP to ASP.net. I'm using VS.net 2003. I would like to use something like an include file to make some common functions available to all of my pages. I'm trying to do this using a class (.vb file) and adding a reference to this class in my .aspx file's code behind page.
The problem is, it looks like if I make the sub/function in my .vb file SHARED, it can't access things like Session, Response and Request. I get this build error : "Cannot refer to an instance member of a class from within a shared method or shared member initializer without an explicit instance of the class."
If I don't make it shared, it can access the session, response and request objects, but I can't access the sub/function from my aspx page. What am I missing here?
The problem is, it looks like if I make the sub/function in my .vb file SHARED, it can't access things like Session, Response and Request. I get this build error : "Cannot refer to an instance member of a class from within a shared method or shared member initializer without an explicit instance of the class."
If I don't make it shared, it can access the session, response and request objects, but I can't access the sub/function from my aspx page. What am I missing here?