hi i have created a session id at the time of login....now how can i pass this session variable to the next page???
Printable View
hi i have created a session id at the time of login....now how can i pass this session variable to the next 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.
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
Does ComboCountry.SelectedValue actually have a value? Set a breakpoint and check it.
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.Quote:
Originally Posted by shadowcodes
Back to the original question.
Check if the SessionState part in the Web.config file is set properly
Here is how it should look like. (Unless you need to do some changes)
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 valuesHTML Code:<sessionState cookieless="false" timeout="20" mode="InProc"></sessionState>