using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; public partial class SiteMaster : System.Web.UI.MasterPage { protected void Page_Load(object sender, EventArgs e) { //if (Page.User.Identity.IsAuthenticated) if (HttpContext.Current.Request.IsAuthenticated) { Username = Page.User.Identity.Name; } } protected void NavigationMenu_MenuItemDataBound(object sender, MenuEventArgs e) { if (SiteMap.CurrentNode != null) { if (e.Item.Text == SiteMap.CurrentNode.Title) { e.Item.Selected = true; } } } public string Username { get; set; } }