I am tring to figure out how to handle input from the confirm dialog. I am using a gridview on which the user can check some checkboxes and then clicks <asp:button> to submit.
I check a condition in the csharp code and based on a condition , I need to display a confirm dialog to the user. So when I do the check on the condition (Server Side) I use RegisterStartupScript to generate the Client Side script for the confirm prompt.
Expand|Select|Wrap|Line Numbers
- if (resultRow != null)
- {
- if (!Page.IsClientScriptBlockRegistered("InfoMessage"))
- {
- string strNumScript = "<script> confirm('Item has already been assigned. Do you wish to continue? ');</script>";
- Page.ClientScript.RegisterStartupScript(GetType(), "InfoMessage", strNumScript);
- }
- }
Can I use the input from the confirm to control execution in the csharp code. Am I on the wrong track here?
Regards