Remo
Remo

Reputation: 389

PageRedirect to previous Page?

I have a page(A) that has a popup. When the link in the popup is clicked, it takes you to page B. Page B has a Submit and cancel button. Cancel button should get me back to Page A. How is it possible with javascript or Asp.net??

Thank you in advance!!

Upvotes: 2

Views: 838

Answers (2)

amit_g
amit_g

Reputation: 31250

<button name="cancel" onclick="history.go(-1)">Cancel</button>

Upvotes: 2

Oliver Moran
Oliver Moran

Reputation: 5157

You can use the history object to navigate backwards:

<input type="button" value="Cancel" onClick="history.back()">

This has the same effect as if the user clicked the back button on their browser.

Upvotes: 3

Related Questions