Cookies and session state in asp.net

thepaine

New Member
I want to take the name the user types in and then display this on another aspx page using session state.On the page where to user types the name the code I have is\[code\]Session["name"] = TextBox1.ToString(); //Store the session state in a variable called name from the text box.Response.Redirect("page2.aspx");\[/code\]Now on page2.aspx I have tried calling this variable but nothing seems to work.I have a empty label1 on the page so I want the name to be stored into the empty label\[code\]Label1 = Session["name"];\[/code\]The error message is convert type object to System.Web.UI.WebControlers.Label
 
Back
Top