ASP / ASP.Net Session Variables


I have some session variables in ASP that I would like to convert to ASP.NET session variables so that I can use them on the .net pages

there are 2 possiblilites I could use

contains a form with the following textfields:

this then gets redirected to sessionstate.aspx

set the ASP.Net session states
username = request.form("username")
company= request.form("company")


sessionstate.aspx convert the session variables

is this possible?

Thanks for any help
Who is Participating?
Jerry MillerConnect With a Mentor Commented:
Then when you redirect it to sessionstate.aspx set the variables this way:

Session("username") =  request.form("username")
Session("company") = request.form("company")

Read this quick article about session best practices, it can help guide you a bit.
Jerry MillerCommented:
You can set or change the session variables on any page that you like. You won't have to create a separate page and redirect to it.

Session("username") =  usernameTextbox..Text
Session("company") = companyTextBox.Text
sanjshah12Author Commented:
Apologies for not being very clear, the user in this case is logged in from an ASP page but ASP.Net pages do not recognise asp variables thus I have created the redirect pages from an ASP to ASPX page.
sanjshah12Author Commented:
Thanks that works great!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.