MVC 5 IsInRole Usage on Razor Views: Cannot connect to Database
问题 I'm having issues using the new identity system in MVC 5, my goal is to make use of the User.IsinRole("RoleName") on Views. For example: @if(User.IsInRole("Administrator")) { <li>@Html.ActionLink("Admin", "Index", "Admin")</li> } This is placed in the main layout page which is hit when the application launches. On doing this, i'm getting the following error: "An exception of type 'System.Web.HttpException' occurred in System.Web.dll but was not handled in user code Additional information: