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

Page security

$
0
0

Hi, in my _Layout.cshtm filr I have the below code.

How do I go about making it so that the PLC Blocks link will only go to that page if some one is logged in.

And can I get who is logged in into a variable, so I can use else where. Thanks,

<div class="navbar-collapse collapse">
                <ul class="nav navbar-nav">
                    <li><a asp-area="" asp-controller="Home" asp-action="Index">Home</a></li>
                    <li><a asp-area="" asp-controller="Home" asp-action="About">About</a></li>
                    <li><a asp-area="" asp-controller="BloodSugar" asp-action="Index">Blood Sugar</a></li>
                    <li><a asp-area="" asp-controller="PLCBlocks" asp-action="Index">PLC Blocks</a></li>

                </ul>
                @await Html.PartialAsync("_LoginPartial")
            </div>


Viewing all articles
Browse latest Browse all 9386

Trending Articles