Hi, I'm trying to implement a customRoleProvider in asp.net MVC 1.0. The class looks like this
using System;
using System.Web.Security;
namespace Project.Web.Services
{
public class CustomRoleProvider: RoleProvider
{
public override bool IsUserInRole(string username, string roleName)
{
throw new NotImplementedException();
}
public override string[] GetRolesForUser(string username)
{
throw new NotImplementedException();
}
public override void CreateRole(string roleName)
{
throw new NotImplementedException();...
I have setup the Web.config file as follows
<configuration>
<system.web>
<roleManager enabled="true" defaultProvider="CustomRoleProvider">
<providers>
<clear/>
<add name="CustomRoleProvider" type="Project.Web.Services.CustomRoleProvider" />
</providers>
</roleManager>
...
when i do this i get a InvalidOperationException thrown in Default.aspx.cs on the httpHandler.ProcessRequest(HttpContext.Current);
line from the code below
public partial class _Default : Page
{
public void Page_Load(object sender, System.EventArgs e)
{
// Change the current path so that the Routing handler can correctly interpret
// the request, then restore the original path so that the OutputCache module
// can correctly process the response (if caching is enabled).
string originalPath = Request.Path;
HttpContext.Current.RewritePath(Request.ApplicationPath, false);
IHttpHandler httpHandler = new MvcHttpHandler();
httpHandler.ProcessRequest(HttpContext.Current);
HttpContext.Current.RewritePath(originalPath, false);
}
}
the error is described as follows The view 'Index' or its master could not be found. The following locations were searched: ~/Views/Home/Index.aspx ~/Views/Home/Index.ascx ~/Views/Shared/Index.aspx ~/Views/Shared/Index.ascx
When I remove the roleManager from Web.config the problem goes away, the problem reapears even when i put the following line into the Web.config
<roleManager enabled="false"></roleManager>
Is there somthing else i need to do?