سؤال

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 :(

هل كانت مفيدة؟

المحلول

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

a possible workaround

نصائح أخرى

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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top