通常 
ScriptManager.RegisterClientScriptBlock(UpdatePanel1, this.GetType(), "click", "alert('提示信息')", true); 
可以说实现对话框
但如果UpdatePanel放在了masterPage里面,那在子页面里怎么写?

解决方案 »

  1.   

    直接用:Page.ClientScript.RegisterStartupScript(Page.GetType(), "Fail", "alert('未选择任何数据!');", true);
      

  2.   

    试用这个:
    http://www.cnblogs.com/insus/articles/1341703.html
      

  3.   

     ScriptManager.RegisterClientScriptBlock(UpdatePanel1, GetType(), "sdf", "<script>alert('123。')</script>", false);
      

  4.   

    UpdatePanel在masterPage里面,子页面里写:ScriptManager.RegisterClientScriptBlock(UpdatePanel....编译都通不过吧!!!!
      

  5.   

    子页面里又没有UpdatePanel的啰
      

  6.   


    //try:
    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "click", "alert('提示信息')", true); 
      

  7.   

    楼上,ScriptManager.RegisterClientScriptBlock(this,“this”指的是?
      

  8.   

    搞定了。
    MessageBox.AlartAjax(this.Page.Master.FindControl("UpdatePanel1") as UpdatePanel, "信息提交成功!");
     public class MessageBox
        {
            public static void AlartAjax(System.Web.UI.UpdatePanel UpdatePanel, string Message)
            {
                ScriptManager.RegisterStartupScript(UpdatePanel, UpdatePanel.GetType(), "pop", "alert('" + Message + "');", true);
            }
    }