注册 登录
编程论坛 ASP.NET技术论坛

[求助]关于alert的问题

重在参与 发布于 2007-08-06 14:41, 959 次点击
Response.Write("<script>alert('点击确定关闭此窗口!')</script>");
我的弹出窗口是这样写的,上面只有一个确定按钮,我想要winfrom中的MessageBox那样的效果,一个确定,一个取消,如果点的取消就不执行操作了,请问ASP。NET中能实现吗?
7 回复
#2
tahn306252007-08-06 14:49

能的,不用alert(),用confirm()吧
比如
Button1.Attributes.Add("onclick","return confirm('您确认要关闭此窗口吗?');");

#3
tahn306252007-08-06 14:50
哦,对了,这句要写在Page_Load(object sender, EventArgs e)中才能有用
#4
重在参与2007-08-06 14:54
那如果点确定怎么关闭网页
#5
cyyu_ryh2007-08-06 14:59

这个我也想实现但是无果
那位知道?

#6
tahn306252007-08-06 15:11

就写个事件处理程序啊

protected void Button1_Click(object sender, EventArgs e)
{
Response.Write("<script>window.close();</script>");
}

#7
tahn306252007-08-06 15:17

就写个事件处理程序啊

protected void Button1_Click(object sender, EventArgs e)
{
Response.Write("<script>window.close();</script>");
}

#8
重在参与2007-08-06 16:09
谢楼上的
1