11 January 2008

Access Session in Classes

In Visual Basic .NET, to access a session value:


System.Web.HttpContext.Current.Session(“MyVariable”)
System.Web.HttpContext.Current.Session(“MyVariable”).ToString()



In Visual Basic .NET, to set a session value:


System.Web.HttpContext.Current.Session(“MyVariable”) = “NewValue”

No comments:

Post a Comment

Twiit.. Twiit... Gulp