mike55 Posted September 27, 2005 Posted September 27, 2005 Hi, I have an error page for my site, this page simple displays the error message and it contains a back button that when clicked should redirect the user back to the previous page. The get this back button operational, i have tried the following: 'Add the following to the page load event. Me.btnBack.Attributes.Add("onClick", "javascript:history.go(-1);") and 'Add the following to the page load event. If Not Page.IsPostBack Then ViewState("ReferrerUrl") = Request.UrlReferrer.ToString() End If and add the following to the click event. Response.Redirect(ViewState("ReferrerUrl").ToString()) None seem to work, any suggestions on what to do? Mike55 Quote A Client refers to the person who incurs the development cost. A Customer refers to the person that pays to use the product. ------ My software never has bugs. It just develops random features. (Mosabama vbforums.com)
Diesel Posted September 28, 2005 Posted September 28, 2005 Me.btnBack.Attributes.Add("onClick", "javascript:history.back();") Although I don't see why this would work if the history.go(-1) didn't. Quote
bri189a Posted September 28, 2005 Posted September 28, 2005 Alternatively as the error page initially loads you can store the url referrer in view state and then when they click the button direct them to what is in the view state for the previously saved url reffer. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.