asp.net 页面中间弹出提示
2009-03-19 19:44
288 查看
cs类文件中:
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
private void doShowEnd(string msg){
if (string.IsNullOrEmpty(msg))
return;
string str = "<div style='z-index:0;left:40%;right:40%;top:20%;padding:5px;position:absolute;text-align:center;width:20%;border:#009900 1px solid;background-color:#f9fff6;'>" +
"<div style='margin:5px'>" + msg + "</div>" +
"<input type='button' value='确定' id='msgShowID' onclick='this.parentNode.parentNode.removeChild(this.parentNode);'/>" +
"</div>";
string script = "document.write(/"" + str + "/");document.close;setTimeout(/"document.getElementById('msgShowID').click();/", 3000);";
Page.ClientScript.RegisterStartupScript(this.GetType(), "msgdiv", script, true);
}
protected void doshow(object sender, EventArgs e)
{
doShowEnd("删除成功");
}
}
页面中:
<asp:Button ID="Button1" runat="server" Text="Button" OnClick="doshow" />
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
private void doShowEnd(string msg){
if (string.IsNullOrEmpty(msg))
return;
string str = "<div style='z-index:0;left:40%;right:40%;top:20%;padding:5px;position:absolute;text-align:center;width:20%;border:#009900 1px solid;background-color:#f9fff6;'>" +
"<div style='margin:5px'>" + msg + "</div>" +
"<input type='button' value='确定' id='msgShowID' onclick='this.parentNode.parentNode.removeChild(this.parentNode);'/>" +
"</div>";
string script = "document.write(/"" + str + "/");document.close;setTimeout(/"document.getElementById('msgShowID').click();/", 3000);";
Page.ClientScript.RegisterStartupScript(this.GetType(), "msgdiv", script, true);
}
protected void doshow(object sender, EventArgs e)
{
doShowEnd("删除成功");
}
}
页面中:
<asp:Button ID="Button1" runat="server" Text="Button" OnClick="doshow" />
相关文章推荐
- ASP.NET弹出提示点击确定之后再跳转页面的方法
- 10种asp.net页面弹出提示信息
- Asp.Net下载页面,并弹出下载提示框
- ASP.NET弹出提示点击确定之后再跳转页面的方法
- ASP.NET弹出提示点击确定之后再跳转页面的方法
- asp.net弹出提示框后页面重定向方法!
- asp.net 页面右下角弹出类似QQ或MSN的消息提示
- Asp.Net下载页面,并弹出下载提示框
- 每日学习总结:CSS:Clear属性的用法、重复交易提示框、弹出提示框后页面变形、asp.net调用smtp服务发送邮件问题
- asp.net 页面右下角弹出类似QQ或MSN的消息提示
- asp.net 后台代码跳转页面前弹出提示框
- ASP.NET Ajax实现弹出提示框,页面变灰不可点击
- ASP.NET页面中弹出提示框
- ASP.NET 直接关闭页面不弹出提示
- asp.net 网站js弹出提示后原页面css样式丢失
- asp.net 后台代码跳转页面前弹出提示框【C#后台提示后调转页面大全
- 10种asp.net页面弹出提示信息
- asp.net 页面右下角弹出类似QQ或MSN的消息提示
- ASP.NET Ajax实现弹出提示框,页面变灰不可点击
- [原创] ASP.NET 中如何弹出提示窗口然后导向另外一个页面