Quantcast
Channel: Security
Viewing all articles
Browse latest Browse all 4737

Could not load type 'Carental.MyRoleProvider'.

$
0
0

Dear Friends

Got this error evry time since i started provide roles, this is my web.config and myprovider class

<roleManager enabled="true" defaultProvider="shayProvider">
<providers>
<add type="Carental.MyRoleProvider" name="shayProvider" />
</providers>
</roleManager>

class

using BuisnessLogic;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;

namespace CarRenting.Security
{
public class MyRoleProvider : RoleProvider
{
public override void AddUsersToRoles(string[] usernames, string[] roleNames)
{
throw new NotImplementedException();
}

public override string ApplicationName
{
get
{
throw new NotImplementedException();
}
set
{
throw new NotImplementedException();
}
}

public override void CreateRole(string roleName)
{
throw new NotImplementedException();
}

public override bool DeleteRole(string roleName, bool throwOnPopulatedRole)
{
throw new NotImplementedException();
}

public override string[] FindUsersInRole(string roleName, string usernameToMatch)
{
throw new NotImplementedException();
}

public override string[] GetAllRoles()
{
throw new NotImplementedException();
}

/// <summary>
/// Get the user role by is user name
/// </summary>
/// <param name="username">the user name</param>
/// <returns>The user role</returns>
public override string[] GetRolesForUser(string username)
{
try
{
using (AccountLogic logic = new AccountLogic())
{
return new string[] { logic.userRole(username) };
}
}
catch (Exception)
{
return new string[] { "" };
}
}

public override string[] GetUsersInRole(string roleName)
{
throw new NotImplementedException();
}

public override bool IsUserInRole(string username, string roleName)
{
throw new NotImplementedException();
}

public override void RemoveUsersFromRoles(string[] usernames, string[] roleNames)
{
throw new NotImplementedException();
}

public override bool RoleExists(string roleName)
{
throw new NotImplementedException();
}
}
}

thnak guys for the help


Viewing all articles
Browse latest Browse all 4737

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>