I have a scenario where I need to show a modal dialog in the middle of C# code execution and then continue the code based on a condition.
Here is an example of what the code might look like:
protected void Button_Click(object sender, EventArgs e)
{
//some code execution
.
.
.
// need to open a modal dialog with 'yes' and 'no' buttons and wait for the response
string popupMessage = "<script language='javascript'>showmodal();</script>";
ClientScript.RegisterClientScriptBlock(this.GetType(), "pop", popupMessage);
if (yes)
{
// do something
}
else if (no)
{
// do something else
}
} // End of Button click
I am seeking advice on how to achieve this using JavaScript without using Ajax.