尚纳游戏
您的当前位置:首页Asp.Netalert弹出提示信息的几种方法总结_javascript技巧

Asp.Netalert弹出提示信息的几种方法总结_javascript技巧

来源:尚纳游戏


1.ClientScript.RegisterStartupScript(GetType(),"message","alert('第一种方式,无白屏!');");

2.HttpContext.Current.Response.Write("alert('第二种方式,有白屏!')");

3.public static void Show(System.Web.UI.Page page, string msg)
{
page.ClientScript.RegisterStartupScript(page.GetType(), "message", "alert('" + msg.ToString() + "');");
}
Show(this, "第三种方式,无白屏,不变形!");

4.Response.Write("alert('第四种方式,有白屏!')");

5.window.showModalDialog('XXX.aspx', '', 'dialogWidth:429px;dialogHeight:200px;location:no,menubar:no,toolbar:no,status:no');

6.Page.clientscript.registerstartupscript(this.gettype(), "", "window.open('../issue/issueallcomment.aspx');");
即可解决.

7.
使用ajax组件的函数,如下:
System.Web.UI.ScriptManager.RegisterStartupScript(this, this.GetType(), "opennewwindow", "alert('弹出框内容!');", true);

8.
在页面的body的最后一行放置一个控件,并在代码页里给这个控件赋值,如:

label.Text="alert('弹出框内容!); ";

显示全文