Click here to Skip to main content
16,021,285 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have an aspx page with repeater control on it used for showing the data.The user can modify the data inside the repeater but the data will not get saved until the SAVE button is hit.
I also have an UNDO button on the page. If the user clicks this button, I want to reload the page and discard the changes made by user (similar to UNDO functionality in MS Office)
I need to show him the same data that was shown when the page was loaded for the first time.

Kindly help me with this.

Thank you !
Posted
Comments
CRDave1988 31-Jan-12 6:09am    
UNDO button is clicked before SAVE or after SAVE
Warreer 31-Jan-12 6:15am    
These two buttons are independent. Undo can be clicked any time even before the save is clicked.

Before SAVE is very Easy
just write following code in ur UNDO click event
Page.Response.Redirect(Page.Request.Url.ToString(), true);

Doing after SAVE is tricky for me sorry for that
 
Share this answer
 
Comments
Warreer 31-Jan-12 6:50am    
Thank you very much, it worked very good for me. Exactly what I was looking for.
Hi,
Keep the data in ViewState that you have already bind to the repeater control.
Track the chages using JavaScript. If user press the undo button compare view state data with the JavaScript recoreded data.

So, You can compare the data and reinstall.But this works for one undo solution not muliple times.
 
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