I have a simple ASP.net (code behind) webpage that has a couple of textboxes. Each textbox has an associated validation control (required, compare, etc.) along with a validation summary control (to display all errors in a single dialog.) I have not added or modified any generated HTML or Javascript.
If the form is successfully validated, I want to display a success message. The only code-behind function I have added is:
Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.Click
If Page.IsValid Then
ClientScript.RegisterStartupScript(Me.GetType(), "key", "<script>alert('Form completed successfully!')</script>")
End If
End Sub
This works fine unless the user refreshes the page, which causes the message "To display the webpage again internet explorer needs to resend the information you've previously submitted."
Pressing either the Retry or Cancel button causes the success message to be displayed again.
I have searched furiously without finding a suitable answer. Are there any other [simple] solutions other than redirecting to another page or disabling IE's error checking?