How do i access session variables from an ASP Page in ASP.Net
The session variables are initialized on the ASP Page when logging in, then i need to access the session variable from an ASP.Net page after clicking a link.
Is the ASP and ASP.NET page both part of the same virtual directory? if not, I'm not sure they can be "shared" in the sense of
TextBoxOnASPNETPage.Text = Session("varfromasppage"
if they are in the same virtual directory, then you should be able to access them in your asp.net pages by just using the
Session("somevarname" =
or
= Session("somevarname"
ASP classic session variables are not accessible in asp.net pages.
Two completely different animals under the covers -- you'll have to either pass them via querystring, store them in a database for .net to grab, or a temp file, or some other solution.
It's a pain, but session has been greatly improved since asp classic, and so they just don't play nicely together.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.