Click here to Skip to main content
15,902,635 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am writing to seek help, in how do i get the following line to read only the identity names only. this is because it currently throws - "The Role Manager feature has not been enabled" error.

C#
if (user.username != null)
            {
                // once the user is verified, assign it to an IPrincipal with the identity name and applicable roles
                principal = new GenericPrincipal(new GenericIdentity(user.username));
               
                return true;
            }


Many thanks for your time and help.
Posted
Updated 14-Feb-14 0:45am
v2

If you are using role base security, then check role base settings for role which you want to use .
 
Share this answer
 
Comments
miss786 14-Feb-14 6:43am    
Thank you for reply. I would like to use identity name property only but when I use that alone, it throws an error.
V5709 14-Feb-14 7:01am    
Hi..check this link...

http://weblogs.asp.net/owscott/archive/2005/08/19/Enabling-Roles-in-ASP.NET-v2.0.aspx
Add following lines to your web.config file.
XML
<roleManager defaultProvider="DefaultRoleProvider">
     <providers>
       <add name="DefaultRoleProvider" type="System.Web.Providers.DefaultRoleProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" applicationName="/" />
     </providers>
   </roleManager>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900