return; 
            Response.Redirect("Login.aspx"); 
跳转页面不会执行的,
你已经return了

解决方案 »

  1.   

    cs.RegisterStartupScript(this.GetType(), "OK!", " <script>alert('你可能没有权限!!');window.location.href='login.aspx' </script>"); 
      

  2.   

     if (selectright != "5") 
            { 
                ClientScriptManager cs = this.ClientScript; 
              
                // Response.Redirect("Login.aspx"); 
                cs.RegisterStartupScript(this.GetType(), "OK!", " <script>alert('你可能没有权限!!') </script>"); 
                //return; 
                Response.Redirect("Login.aspx"); 
            } 
      

  3.   

    cs.RegisterStartupScript(this.GetType(), "OK!", " <script>alert('你可能没有权限!!');window.location.href='login.aspx' </script>");