?
Solved

ASP / ASP.Net Session Variables

Posted on 2012-04-07
4
Medium Priority
?
511 Views
Last Modified: 2012-04-08
Hi,

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

Sessionstate.asp
contains a form with the following textfields:
username
company

this then gets redirected to sessionstate.aspx

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


or

sessionstate.aspx convert the session variables

is this possible?

Thanks for any help
0
Comment
Question by:sanjshah12
  • 2
  • 2
4 Comments
 
LVL 18

Expert Comment

by:Jerry Miller
ID: 37820048
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

http://msdn.microsoft.com/en-us/library/ms178581.aspx
0
 

Author Comment

by:sanjshah12
ID: 37820120
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.
0
 
LVL 18

Accepted Solution

by:
Jerry Miller earned 1600 total points
ID: 37820157
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.

http://www.aspnet101.com/2010/10/asp-net-session-state-best-practices/
0
 

Author Closing Comment

by:sanjshah12
ID: 37821406
Thanks that works great!
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Loops Section Overview
Suggested Courses

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question