1 2 3 4 5 6 7 8 9 10 11 12 13 14
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %> <% if (Request.IsAuthenticated) { %> Welcome <b><%= Html.Encode(Page.User.Identity.Name) %></b>! [ <%= Html.ActionLink("Log Off", "LogOff", "Account") %> ] <% } else { %> [ <%= Html.ActionLink("Log On", "LogOn", "Account") %> ] <% } %>