C# 模式弹出窗口asp.net顶部的警报显示

C# 模式弹出窗口asp.net顶部的警报显示,c#,javascript,asp.net,alert,modalpopupextender,C#,Javascript,Asp.net,Alert,Modalpopupextender,我想知道,如果可能的话,如何在模式弹出窗口上显示alertbox。我使用模式弹出扩展程序来显示用户填写的表单。表单上有用户必须填写的字段,如果用户没有填写字段并单击“提交”,则我希望显示一个警报框。就目前而言,我无法在modalpopup仍处于活动状态时显示alertbox。以下是我尝试使用的alertbox的代码: Page.ClientScript.RegisterStartupScript(this.GetType(), "error", "alert('Please coomple

我想知道,如果可能的话,如何在模式弹出窗口上显示alertbox。我使用模式弹出扩展程序来显示用户填写的表单。表单上有用户必须填写的字段,如果用户没有填写字段并单击“提交”,则我希望显示一个警报框。就目前而言,我无法在modalpopup仍处于活动状态时显示alertbox。以下是我尝试使用的alertbox的代码:

   Page.ClientScript.RegisterStartupScript(this.GetType(), "error", "alert('Please coomplete all of the required fields');", true);
string Msg=“您的消息”;
写(@“警报(“+Msg+”);”);

这对我来说很好

我最终找到了解决方案。原来“Page.Clientscript…”不起作用,因为modalpop up不属于Page。改为使用:ScriptManager.RegisterClientScriptBlock(this,this.GetType(),“myAlert”,“alert('your message');”,true);干杯
 string Msg = "Your Message";
            Response.Write(@"<script language='javascript'>alert('" + Msg + " .');</script>");