我现在设了一个登录名为 gfd
有2个文件夹  A   ,B  
我现在不想让他访问 B
做了个错误的页面是Error.aspx
怎么样写才能让错误后跳转到Error.aspx这个页面,而不是出现堆栈的信息    <location path ="Healthy"> 
            <system.web> 
                <authorization> 
     <deny users="gfd"/>
</authorization> 
            </system.web> 
    </location> 

解决方案 »

  1.   

    <authentication mode="forms">
        <forms name=".ASPXAUTH" loginUrl="/login.aspx" timeout="30" path= "/">
        </forms>
    </authentication>
      

  2.   

    参考
    http://zhidao.baidu.com/question/45792282.html
      

  3.   

    /// <summary>
    /// 认证用户的权限
    /// </summary>
    private void Authenticate()
    {
    //没有登录或Session失效转到登录页面
    if(Session["user"]==null)
    Response.Redirect("~/NoLogin.htm",true);
    //验证用户是否对此功能有编辑权限用:参数(用户名,许可id,许可类型1查看,2编辑)
    bool isCanEdit=HosiiHRMS.Biz.PopedomProxy.Authenticate(Session["user"].ToString(),"EmployeeRecord","2");
    //如果不可编辑
    if(!isCanEdit)
    {
    this.NOEdit();
    this.LBserver.Enabled=false;
    this.LBserver.Attributes.Remove("href");
    this.LBUpdate.Enabled=false;
    this.LBUpdate.Attributes.Remove("href");
    //如果没有浏览权限,则导向到没有权限页面
    if(!HosiiHRMS.Biz.PopedomProxy.Authenticate(Session["user"].ToString(),"EmployeeRecord","1"))
    Response.Redirect("../Authorization/NoPopedom.htm",true);
    }
    }
      

  4.   

     form验证  
      没登陆时指定到一个页面 
      ‘怎么样写才能让错误后跳转到Error.aspx这个页面,而不是出现堆栈的信息 ’ 这里说的错误是 没有权限  还是?  可以配置
     <customErrors mode="RemoteOnly" defaultRedirect="error.aspx">