//先提示信息,然后再跳转!
Page.ClientScript.RegisterStartupScript(this.GetType(), "error", "alert('一个帐户不能同时登陆,请重新登录。');window.location.href='Login.aspx';", true);
在后台的事件方法中(例如点击,页面加载等)
参考:
实现了一个登陆功能,判断成功后,先alert(“登陆成功”);再跳转到指定的页面;
http://zhidao.baidu.com/question/184221959.html
Page.ClientScript.RegisterStartupScript() 方法与Page.ClientScript.RegisterClientScriptBlock() 方法
http://www.cnblogs.com/zhuawang/archive/2007/09/04/881107.html

本文介绍了一种在检测到一个帐户不能同时登录时的处理方式,通过使用Page.ClientScript.RegisterStartupScript方法来实现先弹窗提示再进行页面跳转的功能。此方法适用于ASP.NET Web应用程序。
1235

被折叠的 条评论
为什么被折叠?



