I have a Save button (btnSave) when clicked it would show a popup using Ajax Modal Popup Extender; I also create a prompt message to tell the user that data is saved.
I wanted to show the popup with the message and then when the user click on "OK", it will redirect the user to the previous page. The codes are following.
protected void btnSave_Click(object sender, EventArgs e)
{ Session["Status"] = 1;
SaveData();
Session["Button"] = "S";
lblPanel.Text = "SAVE";
txtPanel.Text = "Data is saved";
btnNO.Text = "OK";
btnYES.Visible= false; //because there is no action; just display a message.
MPE1.Show();
if (Session["Role"].ToString() == "1")
Response.Redirect("List1.aspx");
else if (Session["Role"].ToString() == "2")
Response.Redirect("List2.aspx");
else
Response.Redirect("List3.aspx");
}
}
The problem is when it reaches to the MPE1.Show(), it doesn't show the popup. It continues to go down to those redirect codes and go back to the previous page (List pages) without showing the popup. Can you please show me what is wrong and how to fix it?
Thank you.