Unable to display alert

317 views Asked by At

Actually,I tried showing an alert using ClientScript,But it is not showing .

My code :

ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('File Downloaded at Location C:\\VOWF-Downloads\\');", false);
System.Web.UI.ScriptManager.RegisterStartupScript(this, this.GetType(), "MsgBox", "File Downloaded at Location C:\\VOWF-Downloads\\", true);

Both the codes are not working :(

2

There are 2 answers

0
Luis Miguel On BEST ANSWER

it's not possible to use RegisterStartupScript when devexpress controls execute callbacks.

a possible workaround

0
Vinay Pandey On

Try below:-

ScriptManager.RegisterStartupScript(updatePanel, updatePanel.GetType(), "a_key", "<script type='text/javascript' src='yourfile.js'></script>", false);

ScriptManager.RegisterStartupScript(updatePanel, updatePanel.GetType(), "a_key", "<script type='text/javascript'>alert('file downloaded');</script>", false);

Also in the first line where you are using ClientScript.RegisterStartupScript, include script flag is set to false which I feel should be true in your case.