I’ve got the following code that is supposed to prompt the user that a question has been submitted, and then refresh the page:
protected void ButtonSubmitQuestionClick(object sender, EventArgs e)
{
-- A whole bunch of code that does stuff --
//close window
ScriptManager.RegisterStartupScript(Page, Page.GetType(), "alert", "alert('Your question has been submitted!');window.close();", true);
Response.Redirect("~/QA_QuestionIntake.aspx");
}
The problem is, the popup never appears, presumably because the page refreshes immediately. How can I make the code pause on the alert until the user presses a button?