page_Load()
private void CheckIfUserIsAdmin() { if (Request.IsAuthenticated) { try { string username = User.Identity.Name; if (username == "admin" && User.IsInRole("Administrator")) { Panel PanelAdmin = (Panel)Master.FindControl("PanelAdminMenu"); PanelAdmin.Visible = true; } } catch (NullReferenceException nullex) { nullex.Message.ToString(); } } }
System.Web.UI.Page
Web.UI.Page
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)