I have used sessions in PHP and found them pretty straightforward.
I have been trying to use sessions in ASP.net but I am finding it very tricky!
Can someone please tell me how to simply pass a variable from one page to another?
I am using :
Page 1
Dim testtxt As String
testtxt = "hello"
Session("MySession") = testtxt
Page 2
Dim Testses As String
Testses = Session("MySession")
Response.Write(Testses)
This does not seem to work. Can someone please point out my mistake?
Should I be messing around with the global.asax or web.config files? I don’t want to really; as I just want stand alone pages and not applications.
You have to make sure the ASP.NET pages are in an IIS Virtual Directory, in order to use the session, you really need to run the ASP.NET site as an application, thats the way its been designed.
Bookmarks