Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

Accessing User from _Layout.cshtml in Vs 2015 Sp3 Asp.Net Core

$
0
0

Hello Everyone,

It used to be like this in the previous Version to access the Logged in User from _Layout.cshtml, but now with VS 2015 SP3 Asp.Net it does not seem to work:

@using System.Security.Claims

<!DOCTYPEhtml>

and

@if (User.IsInRole("Admin") || User.IsInRole("Buyer") || User.IsInRole("Seller"))

                    {}

I would appreciate greatly help on how to implement above code for Vs 2015 Sp3 Asp.Net Core.

Thanks a lot, kindest Blessings


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>