ClientScript.RegisterStartupScript(this.GetType(), "script",
"alert('hello !');__doPostBack('__Page',
'EmptyPostback');", true);
To avoid alert message using RegisterStartupScript while click on browser back button.
When we register the startup script with the alert, immediately follow the alert statement with one which will refresh the page. This ensures that the startup script is removed from the page as soon as the OK is clicked, and if the user returns to the page the alert pop up does not reappear.
When we register the startup script with the alert, immediately follow the alert statement with one which will refresh the page. This ensures that the startup script is removed from the page as soon as the OK is clicked, and if the user returns to the page the alert pop up does not reappear.
No comments:
Post a Comment