I have an ASP.NET WebForms application that process a post request and displays a message to the user via JavaScript alert (via ClientScript.RegisterStartupScript
...). At some point after that client-side code executes that refreshes the page and of course I am getting "To display this page, Firefox must send information that will repeat any action (such as a search or order confirmation) that was performed earlier" or similar ones in other browsers.
Now, I know about Post/Redirect/Get pattern, but if I do redirect right after the post - I cannot display the JS alert. Is there a way to display alert and execute server-side redirect? I know I can add a specific querystring to redirect URL, check it on page load and display the alert if it's present, but that means if redirected page is refreshed - I will get that alert again, which is undesirable. Is there a way to do that that wouldn't involve complicated messy flags?