0
我在想,如果可能的话,如何在模态弹出窗口上显示警告框。我正在使用模式弹出式扩展器来显示用户填写的表单。在窗体上有用户必须填写的字段,如果他们没有填写字段并点击提交,那么我想显示一个警告框。就像现在一样,当modalpopup仍然活动时,我无法将alertbox显示出来。下面是alertbox我试图使用代码:莫塔尔弹出窗口上的警报显示asp.net
Page.ClientScript.RegisterStartupScript(this.GetType(), "error", "alert('Please coomplete all of the required fields');", true);
我最终找到解决方案。原因是“Page.Clientscript ....”不起作用,因为modalpop up不属于Page。而是使用: ScriptManager.RegisterClientScriptBlock(this,this.GetType(),“myAlert”,“alert('your message');”,true); 欢呼声 – Snicklefritz