Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to access Session State from class?

I have a Dynamic Data application to which I have added a class for extending EDM. Everything works great, but now I am trying to set an entity property value equal to a value in session state - and its not recognizing the Session command. I'm trying to do something like this:

audit.action_by = CStr(Session("person_name"))

I think this is because I do not have the class Inheriting Page, but if I do add Inherits Page it breaks other stuff. How can I have the class include the ability to utilize sessions directly without inheriting Page?

like image 604
Dave Mackey Avatar asked Dec 01 '25 06:12

Dave Mackey


1 Answers

Try it like this:

HttpContext.Current.Session("person_name")
like image 94
Kris van der Mast Avatar answered Dec 02 '25 20:12

Kris van der Mast



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!