【发布时间】:2012-11-06 17:01:22
【问题描述】:
我想知道如果可能的话,如何在模态弹出窗口上显示一个警报框。我正在使用模式弹出扩展器来显示用户填写的表单。在表单上有用户必须填写的字段,如果他们不填写字段并单击提交,那么我想显示一个警告框。就像现在一样,当 modalpopup 仍然处于活动状态时,我根本无法显示警报框。这是我正在尝试使用的警报框的代码:
Page.ClientScript.RegisterStartupScript(this.GetType(), "error", "alert('Please coomplete all of the required fields');", true);
【问题讨论】:
-
我最终找到了解决方案。结果是“Page.Clientscript ....”不起作用,因为模态弹出不属于Page。而是使用:ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "myAlert", "alert('your message');", true);欢呼
标签: c# javascript asp.net alert modalpopupextender