Click here to Skip to main content
15,908,020 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I want to know that when somebody wants to come back on the previously visited web pages or urls on the same point or a place where he did leave that page or url or a tab menu lastly. or in simple words, if a table contains hundred rows and the visitor was on 58th row when he moved to next page or tab, and while returning back by clicking back in browser then how would I get him on the same row or point or a place where he had left? In the same session as well as in a new session.
Posted

ViewState["PreviousPage"] = Request.UrlReferrer; // In Present Page Store the Url of previous page
Response.Redirect(ViewState["PreviousPage"].ToString());
// In Present Page Button Click redirect to previous page
 
Share this answer
 
Comments
Zafar Sultan 18-Jan-13 4:35am    
Oh dear! you did not read the question.
This is really a no-real-world requirement. Think as a user's perspective. When you click on a link or come back on a page after visiting and leaving and suddenly you get to a position you did not intend to go to, you willl start scratching your head that what's wrong with the application? Nowhere in the web applications it happens(in terms of my very little knowledge). Now for a very no-real-world problem a no-real-world solution:
Use JavaScript function whenever you leave a page(onbeforeunload) and save body scroll position in cookies. Now whenever you comeback to the same page get the cookie and set body scroll. Same thing can be done for tabs etc. All the best and hope it helps.
 
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