|
-
Apr 20th, 2007, 04:20 AM
#1
Thread Starter
Junior Member
passing session variables to the next web page
hi i have created a session id at the time of login....now how can i pass this session variable to the next page???
-
Apr 20th, 2007, 06:32 AM
#2
Re: passing session variables to the next web page
Since Session variables are stored at server side, so once you create and set a Session variable, they all are accessible across whole application. You do not need to pass them from page-to-page.
-
May 5th, 2007, 08:01 AM
#3
New Member
Re: passing session variables to the next web page
I'm having a similar problem.
In my first page, I have:
Session("Country_ID") = ComboCountry.SelectedValue
Session("Region_ID") = ComboRegion.SelectedValue
In my next page I have:
Response.write(Session("Country_ID"))
Response.write(Session("Region_ID"))
And it prints 2 blank lines
Any idea why?
Thanks
-
May 7th, 2007, 05:43 AM
#4
Re: passing session variables to the next web page
Does ComboCountry.SelectedValue actually have a value? Set a breakpoint and check it.
-
May 12th, 2007, 12:16 PM
#5
Member
Re: passing session variables to the next web page
use this
Code:
session(country_id)= ComboCountry.SelectedItem.Text
-
May 12th, 2007, 12:22 PM
#6
Re: passing session variables to the next web page
 Originally Posted by shadowcodes
use this
Code:
session(country_id)= ComboCountry.SelectedItem.Text
It's not necessary for the Value member to be the same as the display member.
Back to the original question.
Check if the SessionState part in the Web.config file is set properly
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
-
May 12th, 2007, 12:25 PM
#7
Re: passing session variables to the next web page
Here is how it should look like. (Unless you need to do some changes)
HTML Code:
<sessionState cookieless="false" timeout="20" mode="InProc"></sessionState>
And make sure you are not calling "Session.Clear" or "Session.Abandon" anywhere in your code unless you want all session variables to loose their values
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|