I have a webform all the controls are in a update panel,i have to write a script for showing error messages in a popup.
These are the scripts i tried
Expand|Select|Wrap|Line Numbers
- 1.private void MessageBox(string message)
- {
- string tmp = "";
- tmp = "<script language='javascript'>";
- tmp += "alert('" + message + "');";
- tmp += "</script>";
- Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "MyScript", tmp);
- }
- 2. private void MessageBox(string message)
- {
- if (!string.IsNullOrEmpty(message))
- {
- Response.Write("<script type=\"text/javascript\" language=\"javascript\">");
- Response.Write("alert('" + message + "');");
- Response.Write("</script>");
- }
- }
these scripts work fine if the button is outside the update panel. I want scripts for displaying on a click of button which is inside update panel.Please reply asap.
Thanks in advance,
Blacky