Click here to Skip to main content
15,867,594 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi everyone. I have a page in asp.net. It initially contains a label, textbox and button. User must input correct value in textbox and then click button. The button event will display two additional panels with more controls. There is a grid in one of these panels and it takes the user to a new page. I do more work here and then want to return to the previous page for more working. Problem is, my page only displays the initial controls and not the modified panels. How can I maintain that work once I come back to it?

I currently have tried:
1.
C#
Response.Redirect("InitialPage.aspx");

2.
C#
Server.Transfer("InitialPage.aspx");

3.
C#
ViewState["UrlRef"] = Request.UrlReferrer; //Saves the Previous page url in ViewState in Page_ Load. 
//if (ViewState["UrlRef"] != null) //Check if the ViewState contains Previous page URL
            //{
            //    Response.Redirect(ViewState["InitialPage.aspx"].ToString());//Redirect to Previous page by retrieving the PreviousPage Url from ViewState.
            //}


But with no success. Still same result. Would really appreciate any help that you can give me. Thank you in advance :)
Posted
Updated 25-Feb-13 3:32am
v2
Comments
ZurdoDev 25-Feb-13 8:54am    
javascript: history.go(-1); You can try that. It's like clicking the back button.

Can you open new page in new window and update opener using javascript as shown [here]?
 
Share this answer
 
Thank you so much for all your help guys. :)

I got my own solution by simply passing an ID from the gridview as a session variable through to the next page and getting it back again when I redirect to that Initial page. Doing so, made me get all the changes I've made before and display the page with all the changes. . .Don't know if anyone understands this, but it's working for me.
 
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