Click here to Skip to main content
15,898,923 members

Comments by Divyay208 (Top 39 by date)

Divyay208 13-Jan-21 11:20am View    
Deleted
Thanks for the reply.. I will create new view any how here also we are creating controls for display and Editor separately.
Divyay208 13-Jan-21 11:20am View    
Thanks for the reply.. I will create new view any how here also we are creating controls for display and Editor separately.
Divyay208 17-Mar-20 14:13pm View    
Thanks for the solution, I modified my code accordingly still it's not working, May be It won't work this way, I updated what I have tried in question. my requirement is similar to https://stackoverflow.com/questions/32764989/asp-net-mvc-5-culture-in-route-and-url

but this is based on current culture.
Divyay208 16-Mar-20 22:38pm View    
I have Implemented the same but I am getting errors in
public class UserRoleHandler : IRouteHandler
{
public IHttpHandler GetHttpHandler(RequestContext requestContext)
{
// Work out the role here, I am hard-coding for simplicity
var listRoles = new List<string> { "Admin", "User", "RRR" };

requestContext.RouteData.Values["role"] = listRoles;

return new MvcHandler(requestContext);
}
}

The error is 'The controller for path '/Home/Index' was not found or does not implement IController.'
Divyay208 16-Mar-20 16:49pm View    
Thanks for the solution, but Roles we get once the user logins, from the above solution 'UserRoleHandler' class getting called way before the Custom Authorize class from filters execution, So I am not getting any roles to implement the above solution