I am using an image button and on click of it i want to go to visited page.
Now i am using - Response.Redirect(Request.UrlReferrer.ToString())
,
It is going to previous page, but when i am in a page of some user details where the link is looks like - users.aspx?userid=25 and i visit some other page and click back(image button) i want to see the same userdetail page. How to track that. Please Guide.
views:
57answers:
2
A:
Hi there.
I would recommend using the Session
object to store the url e.g.
Session("PreviousPage") = Request.Url.AbsolutePath // Or whatever....
You can then make use of the above in other pages to set the back button's url.
EDIT:
In response to your comment, are 100% sure you're saving the current url before moving to the next page?
Protected Sub btnNextPage()
Session("PreviousPage") = Request.Url.AbsolutePath // Or whatever....
Response.Redirect("nextpage.aspx")
End Sub
Cheers. Jas.
Jason Evans
2010-08-25 15:06:01
No luck. Showing the same page. Actually i have placed that response.redirect in the master page.
Yajuvendra
2010-08-25 15:40:31
A:
Do you want your custom back button to always take the user to the same page as the browser's normal back button will? If so, you can use javascript to do that with something like
myBackButton.OnClientClick = "window.history.go(-1);return false;";
stevemegson
2010-08-25 17:31:49