protected void Page_Load(object sender, EventArgs e) { if (HttpContext.Current.User.Identity.IsAuthenticated == false) { //msgbox("Session Timeout"); //Response.Redirect("~/Account"); Response.Redirect("~/Account", false); //write redirect Context.ApplicationInstance.CompleteRequest(); // end response } else { baseUrl = Request.Url.Scheme + "://" + Request.Url.Authority + Request.ApplicationPath.TrimEnd('/');; string vx = ""; try { SBoardContext db = new SBoardContext(); var c = db.Users.ToList().Where(a => a.Email == WebSecurity.CurrentUserName); foreach (var d in c) { vx = d.BrokerName; codename = d.role; } } catch (Exception f) { vx = ""; } BrokerName = vx; } }