MVC 5 IsInRole Usage on Razor Views: Cannot connect to Database

后端 未结 3 891
长情又很酷
长情又很酷 2021-02-07 18:38

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(\"A         


        
3条回答
  •  梦如初夏
    2021-02-07 18:50

    I was having the same problem, however Stunt's answer wasn't working for me. Tried the answer to this question and that solved the issue.

    For the lazy you can try adding this to your web.config file:

     
        
          
        
      
    

提交回复
热议问题