分享

asp.net 后台弹出提示框

 glxym 2014-02-16

asp.net 后台弹出提示框

asp.net 后台弹出提示框 
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返回值,并有选择的执行语句块
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

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多