日期:2014-05-18  浏览次数:20473 次

asp.net 点击按钮,弹出对话框
比如弹出一个确认对话框,信息是“申请成功!”

怎么操作?
之前用的是Response.Write("<script>window.alert('申请成功!');location.href='Apply.aspx';</script>");
可是弹出的对话框背景为白色,不是原来的网页,点击确认之后,返回原网页。

有没有什么办法可以实现delete.Attributes.Add("onclick", "return confirm('您真的要删除吗?');");的这种效果?
弹出对话框的后面是之前的网页,而不是白色。我希望弹出的对话框只有一个确认按钮,不要确认和取消。

------解决方案--------------------
http://www.open-lib.com/Type/175-1.jsp
看看这里有没有适合你需求的
------解决方案--------------------
this.ClientScript.RegisterStartupScript(GetType(),"","<script>alert('申请成功')</script>");
------解决方案--------------------
this.ClientScript.RegisterStartupScript(GetType(),"","<script>alert('申请成功')</script>");
------解决方案--------------------
如果在后台添加脚本的时候,最好不要使用Response.Write();因为它会引起页面布局的改变,推荐你使用
this.ClientScript.RegisterStartupScript(GetType(),"","<script>alert('申请成功');window.location.href='Apply.aspx'</script>");
------解决方案--------------------
用上这个就不会了
this.ClientScript.RegisterStartupScript(GetType(),"","<script>alert('申请成功');window.location.href='Apply.aspx'</script>");