Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

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)

Posted
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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...