title: MVC Displaying name of logged in user in nav bar
body: <p>I'm using twitter bootstrap package in my application for my app layout.
  I mostly use _BootstrapLayout.basic.cshtml as my default layout.</p>
  
  <pre><code>@using System.Web.Optimization
  @using BootstrapSupport
  @using NavigationRoutes
  &lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
      &lt;head&gt;
          &lt;meta charset="utf-8"&gt;
          &lt;title&gt;@ViewBag.Title&lt;/title&gt;
          &lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt;
          &lt;link href="@Styles.Url("~/content/css")" rel="stylesheet"/&gt;
          @RenderSection("head", required: false)
          @RenderSection("jtable", required:false)
          @Html.Partial("_html5shiv")
          @* favicons and touch icons go here *@
      &lt;/head&gt;
      &lt;body&gt;
          &lt;div class="navbar navbar-inverse navbar-fixed-top"&gt;
              &lt;div class="navbar-inner"&gt;
                  &lt;div class="container"&gt;
                      &lt;a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"&gt;
                          &lt;span class="icon-bar"&gt;&lt;/span&gt;
                          &lt;span class="icon-bar"&gt;&lt;/span&gt;
                          &lt;span class="icon-bar"&gt;&lt;/span&gt;
                      &lt;/a&gt;
                      &lt;a class="brand" href="#" title="change in _bootstrapLayout.basic.cshtml"&gt;Sorama&lt;/a&gt;
                      &lt;div class="nav-collapse collapse"&gt;
                          &lt;ul class="nav"&gt;
                              @Html.Navigation()
                          &lt;/ul&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;        
          &lt;div class="container"&gt;
              @Html.Partial("_alerts")
              @Html.Partial("_validationSummary")
              @RenderBody()   
              &lt;hr&gt;
              &lt;footer&gt;
                  &lt;p&gt;&amp;copy; Sorama @System.DateTime.Now.ToString("yyyy")&lt;/p&gt;
              &lt;/footer&gt; 
          &lt;/div&gt;
           @Scripts.Render("~/js")
           @RenderSection("Scripts", required: false)
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>this gives me a page with nav bar 
  <img src="https://i.stack.imgur.com/Wkhrt.png" alt="enter image description here"></p>
  
  <p>How can i show the Welcome message to the logged in User on the right corner of the nav bar? Something like Welcome ABC! and some log off option on side?
  The only thing I know is i can get name of current user from <code>User.Identity.Name</code> but I don't know how to make it appear on menu bar.
  I couldn't find something that could help me so I thought may be I could get it here.</p>
  
  <p><strong>Edit</strong>: After <code>@User.Identity.Name</code> being added in view
  I added above mentioned code after <code>&lt;ul&gt;</code> tag with <code>@html.navigation</code>
  and this is what I get
  <img src="https://i.stack.imgur.com/XCQfo.png" alt="enter image description here"></p>
  
  <p>I get the Welcome Demo on menu bar(next to profile, difficult to see) but it is nothing like I expected.
  Could something be done in <code>DefaultRouteConfig</code> provided by Bootstrap?</p>
  
  <pre><code> public class LayoutsRouteConfig
      {
          public static void RegisterRoutes(RouteCollection routes)
          {
              routes.MapNavigationRoute&lt;ModuleController&gt;("Module", c =&gt; c.Index());
              routes.MapNavigationRoute&lt;AccountController&gt;("Hardware", c =&gt; c.Login());
              routes.MapNavigationRoute&lt;LayoutsController&gt;("Profile", c =&gt; c.Starter())
                    .AddChildRoute&lt;LayoutsController&gt;("Change Password", c =&gt; c.Marketing())
                    .AddChildRoute&lt;AccountController&gt;("Add User", c =&gt; c.Register())
                    .AddChildRoute&lt;LayoutsController&gt;("Logout", c =&gt; c.SignIn())
                  ;
  
          }
      }
  </code></pre>