In an ASP.NET MVC project I would like to display a brief message to the user, eg. 'Hello, username!'
i the navigational bar, if the user is signed in. I'm using the standard bootstrap layout, and trying this, but it appears weirdly. I'm not sure what CSS ot HTML to change. Here's what I'm trying.
@if (Session["Username"] != null)
{
<ul class="nav navbar-nav navbar-right">
<li>Hello, @Session["Username"]</li>
<li>@Html.ActionLink("Logout", "Logout", "Home")</li>
</ul>
}
else
{
<ul class="nav navbar-nav navbar-right">
<li>@Html.ActionLink("Register", "Register", "Home")</li>
</ul>
}
That's in my _Layout page. The right text appears, but it's kind of off-centre and dark, not easily visible. How can I make it appear just like the actionlinks?