Click here to Skip to main content
15,901,426 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to save information during postback of url.
Posted
Comments
[no name] 29-Aug-12 3:04am    
which data you want to retain after the postback e.g Password
_Amy 29-Aug-12 3:15am    
PostBack of URL? Doesn't make any sense.
vickyc049 29-Aug-12 3:31am    
Use State Management

Hi ,
Well you can use ViewState
C#
Viewstate.Add( "MyViewState", "test" );

C#
if( Viewstate["MyViewState"]!=null)
{
   string MyData =  Viewstate["MyViewState"].ToString();
}

Check this links
Beginner's Guide To View State [^]
http://msdn.microsoft.com/en-us/library/ms972976.aspx[^]
ViewState [^]
Best Regards
M.Mitwalli
 
Share this answer
 
Try enabling ViewState property of your controls or otherwise before postback of your page save the page data in Session or ViewState and rebind your controls in IsPostBack of your Page_Load function.


--Amit
 
Share this answer
 
 
Share this answer
 
v2
Check this. You will realise the reason and what should be done to prevent it.
http://stackoverflow.com/questions/5531294/why-my-data-is-lost-after-postback[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900