国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 編程 > JavaScript > 正文

Asp.Net alert彈出提示信息的幾種方法總結(jié)

2019-11-20 21:10:43
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友

1.ClientScript.RegisterStartupScript(GetType(),"message","<script>alert('第一種方式,無(wú)白屏!');</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, "第三種方式,無(wú)白屏,不變形!");

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組件的函數(shù),如下:
System.Web.UI.ScriptManager.RegisterStartupScript(this, this.GetType(), "opennewwindow", "alert('彈出框內(nèi)容!');", true);

8.
在頁(yè)面的body的最后一行放置一個(gè)控件,并在代碼頁(yè)里給這個(gè)控件賦值,如:

label.Text="<script>alert('彈出框內(nèi)容!); </script> ";

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 营口市| 延寿县| 河间市| 邛崃市| 嫩江县| 大连市| 兰州市| 乐业县| 济宁市| 石阡县| 双辽市| 济源市| 墨脱县| 新龙县| 红河县| 利津县| 汶川县| 平顺县| 甘德县| 策勒县| 涪陵区| 华阴市| 大邑县| 都兰县| 宁波市| 临夏市| 柘荣县| 乐平市| 淮北市| 建始县| 康定县| 罗定市| 龙山县| 马尔康县| 紫阳县| 阜城县| 水城县| 洛浦县| 日喀则市| 黄大仙区| 历史|