I created a page that shows a user a receipt that says they have successfully completed a payment from a third party site. I am trying to prevent the user from going back to the third party's page and making a duplicate payment. I was thinking I could logout the user when they hit the back button so that it would kick them off the site and onto the login page.
I tried using:
protected void Page_Unload(object sender, EventArgs e)
{
Response.Redirect("Login.aspx");
}
but I get the error: "System.Web.HttpException: Response is not available in this context"
The flow of the site is: login on Login.aspx then fill out an application on the next page. After completion of application the submit button takes the user to a page where they select defer payment or pay with card. If they pay with card they are taken to the third party site and fill out their information. The third party site then sends them back to receipt page that I created.
So the question is: how would I go about logging someone out upon hitting the back button?