手机
当前位置:查字典教程网 >编程开发 >Javascript教程 >Asp.Net alert弹出提示信息的几种方法总结
Asp.Net alert弹出提示信息的几种方法总结
摘要:1.ClientScript.RegisterStartupScript(GetType(),"message","alert('第一种方式...

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

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

3.public static void Show(System.Web.UI.Page page, string msg)

{

page.ClientScript.RegisterStartupScript(page.GetType(), "message", "<script language='javascript' defer>alert('" + msg.ToString() + "');</script>");

}

Show(this, "第三种方式,无白屏,不变形!");

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

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

6.Page.clientscript.registerstartupscript(this.gettype(), "", "<script>window.open('../issue/issueallcomment.aspx');</script>");

即可解决.

7.

使用ajax组件的函数,如下:

System.Web.UI.ScriptManager.RegisterStartupScript(this, this.GetType(), "opennewwindow", "alert('弹出框内容!');", true);

8.

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

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

【Asp.Net alert弹出提示信息的几种方法总结】相关文章:

javascript实现Table排序的方法

创建你的第一个AngularJS应用的方法

JavaScript获得url查询参数的方法

js兼容火狐获取图片宽和高的方法

JavaScript实现表格点击排序的方法

jQuery实现返回顶部效果的方法

js+html5实现canvas绘制镂空字体文本的方法

javascript常用方法总结

jQuery实现转动随机数抽奖效果的方法

jQuery实现页面内锚点平滑跳转特效的方法总结

精品推荐
分类导航