表单验证和角色库访问 [英] Forms Authentication & Role base Access

查看:64
本文介绍了表单验证和角色库访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!

我目前正在研究基于客户表单的身份验证
我创建了两个类UserCredentials和UserRole,这两个类与我的DataAccess.dbml链接.在此类中定义了用户表和角色主控器

我已将以下代码添加到web.cofig文件中.

Hi!

I am currently working on custome form based authentication
i have created two classes UserCredentials and UserRole and these two classes link with my DataAccess.dbml. User table and Role master is defined in this class

I have added the following code to web.cofig file.

<authentication mode="Forms">
    <forms loginUrl="UI/Login/Login.aspx" defaultUrl="Home.aspx">

    </forms>

  </authentication>

  <authorization>
    <allow roles="Admin" />
    <deny users="*" />
    <allow roles="Admin" />
  </authorization>
  <membership defaultProvider="UserCredentials" >
    <providers>
      <clear/>
      <add name="UserCredentials"  type="UserCredentials"/>

    </providers>
  </membership>

  <roleManager defaultProvider="UserRole"  >
    <providers >
      <clear/>
      <add name="UserRole" type="UserRole"/>
    </providers>
  </roleManager>




当我尝试从asp.net网站管理工具iam定义安全规则时,收到以下错误..

"




when i am trying to define the security rules from asp.net website admin tool iam getting the below error..

"

There is a problem with your selected data store. This can be caused by an invalid server name or credentials, or by insufficient permission. It can also be caused by the role manager feature not being enabled. Click the button below to be redirected to a page where you can choose a new data store.

The following message may help in diagnosing the problem: Could not load type 'CustomMember'. (C:\Sanjay\test1\test1\web.config line 64)


"


我正拼命等待解决方案..


谢谢


"


I am desperately waiting for the solution..


Thank you ,

推荐答案

添加此
<rolemanager enabled="true"></rolemanager>


这篇关于表单验证和角色库访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆