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

后端 未结 3 886
长情又很酷
长情又很酷 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:49

    I managed to get around the problem by removing the following line from my Web Config:

    
    

    This was found when looking after comparing line for line on the following example code:

    https://github.com/rustd/AspnetIdentitySample/tree/master/AspnetIdentitySample

提交回复
热议问题