protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack && Request.Url.LocalPath.ToString() != "/Account/Login") { Core.Core User = new Core.Core(); if (!User.IsUserAuthenticate()) { string OriginalUrl = HttpContext.Current.Request.RawUrl; string LoginPageUrl = "/Account/Login.aspx"; HttpContext.Current.Response.Redirect(String.Format("{0}?ReturnUrl={1}", LoginPageUrl, OriginalUrl)); } //else //{ // try // { // if (User.User.Identity.Name == "lucia") // { // ((HtmlGenericControl)lv.FindControl("MyCollectionsMenuItem")).Style.Add("visibility", "visible"); // } // else // { // ((HtmlGenericControl)lv.FindControl("MyCollectionsMenuItem")).Style.Add("visibility", "hidden"); // } // } // catch (Exception ex) // { // Response.Write(ex.Message); // } //} } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack && Request.Url.LocalPath.ToString() != "/Account/Login") { Core.Core User = new Core.Core(); if (!User.IsUserAuthenticate()) { string OriginalUrl = HttpContext.Current.Request.RawUrl; string LoginPageUrl = "/Account/Login.aspx"; HttpContext.Current.Response.Redirect(String.Format("{0}?ReturnUrl={1}", LoginPageUrl, OriginalUrl)); } } }