After deleting the row in the gridview, i wish to fire an alert message saying that “Record was successfully deleted”
I have written the following code
StringBuilder sb = new StringBuilder();
sb.Append(@"<script language='javascript' type='text/javascript' >function demoalert() {");
sb.Append(@"alert('Hello!demo!');");
sb.Append("} </script>");
ClientScript.RegisterStartupScript(this.GetType(), "Delete", sb.ToString());
and after this code, i am binding my grid with datasource and updating the update panel. The alert doesn’t fire up.
Script debugging is not disabled in my IE (IE-8)
Please guide!
Are you calling the
demoalert()function after writing it to the page? Unless we’re missing code, it appears that you’re not calling the function.If that’s the case, simply change your last Append to:
Alternatively, you could remove the function altogether: