I am doing web development.
I have a page to do with credit card, which when user click "refresh" or "Back", the transaction will be performed one more time, which is unwanted.
This include Browser top left "Back" & "Refresh" button, "right click->Refresh/Back", press "F5" key. This is to be done on certain cgi page only, not all of them.
Can this be done using Javascript? Or any other method?
Just put this javascript on the html section of aspx page above head section
We need to put it on the html section of the page which we want to prevent user to visit by hitting the back button
Complete code of the page looks like this
If you want to disable back button using code behind of aspx page,than you need to write below mentioned code C# code behind
We can also achieve this by disabling browser caching or cache by writing this line of code either in Page_load event or in Page_Init event
Demo is :