I have an app with some user controls. When I send this information (session("test") = txtTest.text) to a new page using Server.transfer everything works fine. My problem is that when I click Back the txtText.text is reloaded and the entered value is gone. What goes wrong? Is it something I can prevent by settings in the web.config?
I am using VS2002, could that be the reason?
If you're just clicking Back, the page state was lost so you'll need something like the following in the page load(and remember to check for "if not page.ispostback"):
post some code(the piece that assigns the session var and the server.transfer), maybe it's somethin with how you're assigning the session var. And you're inside visual studio when you do this? if you are does the same thing happen when you use a stand alone browser?
System.Web.HttpContext.Current.Session["var"]/("var") is always a good idea. If you have trouble, or your in a weird place and you don't know where to find the Session. It is exactly what it implies the Current.Session/Request/Response/Server....
Also, EnsureChildControls() will make sure that the page and all it controls exist and can be accessed. Well it should.