提示未登录,点确认,跳到登陆页
1、
ClientScript.RegisterClientScriptBlock(GetType(), "", "<script>alert('你还没有登录!');window.location='login.aspx'</script& gt;");
2、
ClientScript.RegisterStartupScript(this.GetType(), "myscript", "<script type='text/javascript'>alert('你还没有登录!');</script>");
跳转到根目录,用下面的语句:
string scriptStr = "javascript:top.location='Login.aspx'";
this.ClientScript.RegisterStartupScript(this.GetType(), "exit", scriptStr, true);