void Page_Load(Object sender, EventArgs e) { m_userRole = MyFlightbook.Profile.GetUser(Page.User.Identity.Name).Role; using (StringWriter sw = new StringWriter(System.Globalization.CultureInfo.CurrentCulture)) { m_tw = new HtmlTextWriter(sw); WriteTabs(TabList.Tabs); LiteralControl lt = new LiteralControl(sw.ToString()); plcMenuBar.Controls.Add(lt); } }
void Page_Load(Object sender, EventArgs e) { m_userRole = MyFlightbook.Profile.GetUser(Page.User.Identity.Name).Role; NeedsAndroidHack = (Request != null && Request.UserAgent != null && Request.UserAgent.ToUpper(CultureInfo.CurrentCulture).Contains("ANDROID")); using (StringWriter sw = new StringWriter(System.Globalization.CultureInfo.CurrentCulture)) { m_tw = new HtmlTextWriter(sw); WriteTabs(TabList.Tabs); LiteralControl lt = new LiteralControl(sw.ToString()); plcMenuBar.Controls.Add(lt); } }
protected void BuildSidebar() { if (this.TabList == null) { return; } ProfileRoles.UserRole userRole = MyFlightbook.Profile.GetUser(Page.User.Identity.Name).Role; plcSidebar.Controls.Clear(); foreach (TabItem ti in this.TabList.Tabs) { // don't display empty tabs. Used for flight analysis. if (String.IsNullOrEmpty(ti.Text)) { continue; } if (ti.Roles.Count > 0 && !ti.Roles.Contains(userRole)) { continue; } Boolean fSelected = (ti.ID == CurrentTab); if (fSelected) { Label l = new Label(); plcSidebar.Controls.Add(l); l.Text = ti.Text; l.CssClass = "sidebarSelected"; } else { HyperLink a = new HyperLink(); plcSidebar.Controls.Add(a); a.NavigateUrl = ti.Link; a.Text = ti.Text; a.CssClass = "sidebarUnSelected"; } } }