How do I remove a page from the browser history?

前端 未结 8 1656
孤独总比滥情好
孤独总比滥情好 2021-02-07 11:21

I have an have an ASP.Net page which contains a button. This Page contains a ServerSide Paypal button.

When pushed my server does various clever things on the back end a

相关标签:
8条回答
  • 2021-02-07 11:45

    I'm not sure if that can be done. But here is an idea how you could prevent that resubmit of the form.

    You could insert a hidden input in your form which at the beginning would be empty. On submit you'll write a value in that field and make sure you check on every submit attempt if this field is empty.

    If it is not empty on submit you know that the form was previously sent and you could warn the user.

    0 讨论(0)
  • 2021-02-07 11:49
    window.location.replace(URL);
    

    window.location:

    replace(url)

    Replace the current document with the one at the provided URL. The difference from the assign() method is that after using replace() the current page will not be saved in session history, meaning the user won't be able to use the Back button to navigate to it.

    0 讨论(0)
提交回复
热议问题