Access Session Object from DLL

  • Thread starter Thread starter bob garbados
  • Start date Start date
B

bob garbados

I'm trying to access the Session Object from a vb.net DLL in my asp.net
application.

If I use this code:
System.Web.HttpContext.Current.Session("some_var")

I get this error: BC30456: 'HttpContext' is not a member of 'Web'.

What am I missing?
 
Try accessing it without the System.Web (ie: HttpContext.Current.Session)
instead. It works that way for me.

Hope this helps,
Mark Fitzpatrick
Microsoft MVP- FrontPage
 
Thanks Mark.

I added the statement Imports System.Web and tried it like you suggested
with no luck. The error I see now is BC30451: Name 'HttpContext' is not
declared.
 
I was missing something pretty simple... I forgot the reference for
System.Web.dll

vbc /out:Commerce.dll /t:library CommerceUtils.vb /r:System.dll
/r:System.Web.dll

Main Entry: dufus
Function: noun
Definition: an incompetent and stupid, though well-meaning, person; also
called doofus

Thanks for the suggestions.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top