ASP.NET先显示‘提示信息’然后再跳转---Page.ClientScript.RegisterStartupScript()

//先提示信息,然后再跳转!
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


 

你可能感兴趣的:(ASP.NET先显示‘提示信息’然后再跳转---Page.ClientScript.RegisterStartupScript())