Session problem

aliweb

Active member
Joined
Sep 14, 2005
Messages
40
Programming Experience
3-5
I have page named Page1.aspx which contain the following code in Page_Load event.

VB.NET:
Session("test") = "Hello"

There is also a link on that page which when you click goes to Page2.aspx.
This second page Page2.aspx contain one web user control named UserControl1.ascx. I have written the following code in Page_Load of this user control

VB.NET:
Response.write Session("test")

but nothing prints! :(
 
Well maybe this is not big deal and also i think VS.NET intellisense will fix it for you but however it is worthy to be mentioned. You should always put it inside brackets i.e.
VB.NET:
[SIZE=2]Response.Write(Session("test"))[COLOR=darkgreen] 'it is valid for ASP.NET ... unlike classic ASP[/COLOR]

Regards ;)[/SIZE]
 
Back
Top