When you create a new MVC project, the csproj template creates a partial view called "LoginUserControl" located in ~ / Views / Shared / LoginUserControl.ascx.
This view has the following logic, which displays different text depending on whether the current user is registered:
<% if (Request.IsAuthenticated) { %> Welcome <b><%= Html.Encode(Page.User.Identity.Name) %></b>! [ <%= Html.ActionLink("Logout", "Logout", "Account") %> ] <% } else { %> [ <%= Html.ActionLink("Login", "Login", "Account") %> ] <% } %>
source share