Last post Jan 20, 2012 06:58 AM by MetalAsp.Net
Jan 20, 2012 03:32 AM|kimdobranski|LINK
I am having odd behaviour with session state. If you create an empty web form, add a button (just to cause a postback), and the following code and run. When you click the button, the session("number") returns "5" as expected.
However, create a blank master form, create an empty child web form, and add this SAME code with a button, run, and press the button, session is "nothing"
am i missing something?
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Session("Number") = Nothing Then
'If this page has a master, Session("number") always returns Nothing after the postback
Session("Number") = 5
'If this page has a master, Session("number") returns 5 after the postback
'Session retained value
Jan 20, 2012 06:58 AM|MetalAsp.Net|LINK
Where do you have the page_load, in the master or the content page? This might answer your dilemna: