Click here to Skip to main content
15,843,149 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
I have few reports in the same page..and a "BACK to Reports" button in another page..The button is redirecting the page .When button is clicked I need to get back to same place as it was earlier..How can i do this ?

someone pls help me with the code..

1.In your reports page use anchors in places where you want to come back, like in the next example;
<h2><a name="1">Your 1st Report</a></h2>
<h2><a name="2">Your 2nd report</a></h2>
2.Then when you start a report your should send (or cache) as parameter also the anchor name, for example if you start the 2nd report you should send (or cahce) also the value "2".
3.Finally build your URL for back button by using also the param from point above by adding a "#2" at the end of the URL in the case of example from point 2 above.
Share this answer
Challa92 24-Mar-14 3:33am    
Thanq for reply.. I got solution...
Raul Iloc 24-Mar-14 3:35am    
declare globally
static string prevPageUrl = String.Empty;
to write this in page_load event
prevPageUrl = Request.UrlReferrer.ToString();

in btn_click()

refer this link also you can get idea how many ways to get previous url
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