首页 新闻 会员 周边

关于弹出提示窗口的问题

0
悬赏园豆:5 [已解决问题] 解决于 2012-09-28 14:30

点击一个按钮弹出一个提示框然后是跳转到另一个页面,但是提示框弹不出,直接跳转了,怎么办?

这是弹出提示窗代码

private void ShowMessage(string message)
        {
            ScriptManager.RegisterStartupScript(this.AjaxPanel5, this.AjaxPanel5.GetType(), Guid.NewGuid().ToString(), "alert('" + message + "')", true);
        }

这是按钮点击的部分代码

 this.ShowMessage("Custom Commands have been sent to the EKS lead for review");
            this.Response.Redirect("CustomCommand.aspx");
阿磊ing的主页 阿磊ing | 初学一级 | 园豆:2
提问于:2012-09-28 13:59
< >
分享
最佳答案
0

你这个根本做不到,是否需要有弹出框的,你放一个标示到客户端,比如放1到hidden控件中标示要做某个事情,然后客户端在widnow.onload=function(){

if(doucment.getelementbyid("hidden1").value="1")

{

alert("diaozhuan")?

window.location.href="目的地的url";

}

}

收获园豆:5
chenping2008 | 大侠五级 |园豆:9836 | 2012-09-28 14:12

OK.谢了

阿磊ing | 园豆:2 (初学一级) | 2012-09-28 14:30
其他回答(1)
0

可以换一个跳转方法;

this.ShowMessage("Custom Commands have been sent to the EKS lead for review");
ScriptManager.RegisterStartupScript(this.AjaxPanel5, this.AjaxPanel5.GetType(), Guid.NewGuid().ToString(), "window.location.href='default2.aspx';", true);
汉水银梭 | 园豆:202 (菜鸟二级) | 2012-09-28 14:19

谢谢你了

支持(0) 反对(0) 阿磊ing | 园豆:2 (初学一级) | 2012-09-28 14:31
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册