日期:2014-05-17  浏览次数:20407 次

网页中弹出消息框
用HTML,javascript,C#语言都行,完成在一个页面弹出一个只有确定按钮的消息框,要在当前网页出现,不要后面是白屏的,
如Response.Write("<script>alert('你要给出的消息。');</script>");等等,请教了,谢谢,如果给的全点更好!

------解决方案--------------------
C# code
           String csname1 = "PopupScript1";
            Type cstype = this.GetType();
            ClientScriptManager cs = Page.ClientScript;
            if (!cs.IsStartupScriptRegistered(cstype, csname1))
            {
                String cstext1 = "alert('用户或密码不正确!');";
                cs.RegisterStartupScript(cstype, csname1, cstext1, true);
            }

------解决方案--------------------
this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "alert('添加成功!');", true);
不会空白的,有没有试啊!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
------解决方案--------------------
Page.RegisterStartupScript("", "<script>alert('填写不能有空!请认真填写!');</script>");