it's not possible to use RegisterStartupScript when devexpress controls execute callbacks.
Unable to display alert
-
27-06-2022 - |
سؤال
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 :(
المحلول
نصائح أخرى
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.
لا تنتمي إلى StackOverflow