protected void Page_Load(object sender, EventArgs e) { manager = new routineManager(); authenticated = System.Web.HttpContext.Current.User.Identity.IsAuthenticated; currentUser = authenticated ? HttpContext.Current.User.Identity.Name : ""; cnr = LoginView1.FindControl("CreateNewRoutine") as ui_uc_CreateNewRoutine; if (authenticated && cnr != null) { cnr.userID = manager.getUserID(currentUser); } }
protected void Page_Load(object sender, EventArgs e) { HtmlGenericControl li = (HtmlGenericControl)this.Page.Master.FindControl("Ulnav").FindControl("liuserRoutines"); li.Attributes.Add("class", "active"); manager = new routineManager(); authenticated = System.Web.HttpContext.Current.User.Identity.IsAuthenticated; currentUser = authenticated ? HttpContext.Current.User.Identity.Name : ""; if (authenticated) { cnr = LoginView1.FindControl("CreateNewRoutine") as ui_uc_CreateNewRoutine; dmr = LoginView1.FindControl("DeleteModifyRoutine") as ui_uc_DeleteModifyRoutine; crl = LoginView1.FindControl("ucCreateRoutineLog") as ui_uc_ucCreateRoutineLog; mdrl = LoginView1.FindControl("ucModifyDeleteRoutineLog") as ui_uc_ucModifyDeleteRoutineLog; mvRoutines = LoginView1.FindControl("mvRoutine") as MultiView; pnlButtons = LoginView1.FindControl("pnlButtons") as Panel; btnBack = LoginView1.FindControl("btnBack") as Button; lbRoutines = LoginView1.FindControl("lbRoutines") as ListBox; pnlRoutineList = LoginView1.FindControl("pnlRoutineList") as Panel; } if (!IsPostBack) { pnlRoutineList.Visible = false; if (authenticated) { pnlButtons.Visible = true; btnBack.Visible = false; } } if (authenticated && cnr != null) { cnr.userID = manager.getUserID(currentUser); } if (authenticated && dmr != null) { dmr.userID = manager.getUserID(currentUser); } if (authenticated && crl != null) { crl.userID = manager.getUserID(currentUser); } if (authenticated && mdrl != null) { mdrl.userID = manager.getUserID(currentUser); } }