asp.net 后台弹出提示框

01-01 生活常识 投稿:良人未归
asp.net 后台弹出提示框

asp 后台弹出提示框

asp 后台弹出提示框 
1.后台弹出提示信息方法
Response.Write(" scripttype="text/javascript" alert('你所查询的数据不存在!'); /script
//弹出提示信息,但页面空白
Page.RegisterClientscriptBlock("tishi", " scripttype="text/javascript" alert('你所查询的数据不存在'); /script
//弹出提示信息,但页面空白
Page.RegisterStartupscript("tishi", " scripttype="text/javascript" alert('你所查询的数据不存在'); /script //已过期,
//弹出提示信息,页面不空白
Clientscript.RegisterClientscriptBlock(this.GetType(), "tishi"," script type="text/javascript" alert('你所查询的数据不存在!'); /script
//弹出提示信息,但页面空白
Clientscript.RegisterStartupscript(this.GetType(), "tishi"," script type="text/javascript" alert('你所查询的数据不存在!'); /script
//弹出提示信息,页面不空白

//在vs2005中 需要引入System.Web.Extensions.dll   必须加
scriptManager.RegisterClientscriptBlock(this.btnTiShi, typeof(Button),"tishi", "alert('你所查询的数据不存在!');", true);
//弹出提示信息,但页面空白
scriptManager.RegisterClientscriptBlock(this, this.GetType(),"tishi", "alert('你所查询的数据不存在!');", true);
//弹出提示信息,但页面空白,this表示page
scriptManager.RegisterStartupscript(this.btnTiShi, typeof(Button),"tishi", "alert('你所查询的数据不存在!');", true);
//弹出提示信息,页面不空白;

该方法已成功
scriptManager.RegisterStartupscript(Page,typeof(Page), "tishi","alert('你所查询的数据不存在!');", true);
//弹出提示信息,页面不空白
scriptManager.RegisterStartupscript(this, typeof(_Default), "tishi",script, true);
//弹出提示信息,页面不空白,this表示page
//后台获得/confirm/i返回值,并有选择的执行语句块
C#端:
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.btnTiShi.Attributes.Add("onclick","tishi()");
}
}
protected voidbtnTiShi_Click(object sender, EventArgs e)
{
if (this.hidevalue.Value == "1")
{
Response.Write("success");
}
else

声明:伯乐人生活网所有作品(图文、音视频)均由用户自行上传分享,仅供网友学习交流。若您的权利被侵害,请联系ttnweb@126.com