Confirm form resubmission on browser back button

Posted by kbm5evm-16703 under ASP.NET on 2/8/2013 | Points: 10 | Views : 2349 | Status : [Member] | Replies : 2
Hi...

In my web Appliction i had a page products.aspx, By clicking on product it should be redirected to ProductEdit page by passing the id of product as url and it is working fine. but after this when clicked on browser back button. it is redirecting to error page confirm page resubmission. i am using google chrome as my browser.
and in Internet Explorer it is webpage Expired.


how can i rectify this...?

Thanks in advance..




Responses

Posted by: Ankitsrist on: 2/8/2013 [Member] Starter | Points: 25

Up
0
Down
try the below code nd put under header section of .aspx page
<script type = "text/javascript">

window.onbeforeunload= function ()
{
return "Do you want to leave this page?";
};
</script>


kbm5evm-16703, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ankitsrist on: 2/8/2013 [Member] Starter | Points: 25

Up
0
Down
sorry i misunderstood ur query, actualy i thought ur need is to show confirmation dialog box when user clicks browser back button

kbm5evm-16703, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response