Reputation: 33
I have used azure login in asp.net core , when logout from project , its going on sign in page where get navbar shown in image. how can I remove navbar
<div class='page-topbar @ViewData["pagetopbar_class"]'>
<nav class="navbar navbar-expand-lg navbar-light " style="background-color:white;">
.
.
.
.
@if (User.Identity.IsAuthenticated)
{
...
}
else
{
...
}
</form>
</div>
</nav>
</div>
Upvotes: 0
Views: 203
Reputation: 300
Try this :
<div class='page-topbar @ViewData["pagetopbar_class"]'>
@if (User.Identity.IsAuthenticated)
{
<nav class="navbar navbar-expand-lg navbar-light " style="background-color:white;">
.
.
.
.
@if (User.Identity.IsAuthenticated)
{
...
}
else
{
...
}
</form>
</div>
</nav>
}
</div>
Upvotes: 0
Reputation: 604
Add if clause to your code As you used for sign out:
@if (User.Identity.IsAuthenticated)
<ul class="navbar-nav mr-auto">
<li class="nav-item active pl-5">
<a class="nav-link" href="/">Home <span class="sr-only">(current)</span></a>
</li>
......
Upvotes: 1