Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How: Accessing Session Variables

Status
Not open for further replies.

kadaver

IS-IT--Management
Sep 9, 2002
13
ZA
Hi,

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.

Thanks
 
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")

D'Arcy
 
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.

sorry. :-(
paul
penny1.gif
penny1.gif
 
did not know that...damn, that would be a paint to use both classic and .NET.

Thanks for the info Paul

D
 
Damn, what a mission, oh well guess i'll have to work around it then.

But thanks a lot paul, i'll be passing them with a querystring then :)

W
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top