Name 'Session' not declared.

liunx

Guest
I'm getting a

error BC30451: Name 'Session' is not declared

in a .vb file when trying to compile it into an assembly. Here is the line of code:

Session("userType") = "s"

I assume its because I'm not Importing a namespace but I can't for the life of me figure out which namespace to import. I've already tried system.web.sessionstate but it did nothing for me. Can anyone direct?Is the .vb file codebehind for a page, or does it contain a module? If it is for a module, you need to pass an HTTPSessionState object in to the function you're trying to use it in.you might try this:

Session.Contents("userType") = "s"

I assume that you created this userType from a login.??? If so, you will need to create something like this for your login code:
Session.Contents("username") = reader("username")

then you can access the session.contents on the next page.

let me know if this workswhat i really need is for someone to try compiling a .vb file into a .dll where the .vb file makes reference to a Session.Contents("whatever"). It doesn't want to compile.
 
Top