private void PageBase_PreLoad(object sender, EventArgs e) { // Code added by Varun for NoRedirection functionality - 28 Jan 2013 SessionValue _objSessionValue = null; TributesPortal.Utilities.StateManager stateManager = StateManager.Instance; // Validate if Query string contains NoRedirection -- true string noRedirection = Convert.ToString(HttpContext.Current.Request.QueryString["NoRedirection"]); if (noRedirection != null && noRedirection.ToLower() == "true") { // Save NoRedirection value in Database UsersController _controller = new UsersController(); _objSessionValue = new SessionValue(true); stateManager.Add("objSessionvalue", _objSessionValue, StateManager.State.Session); _controller.SessionStore(_objSessionValue, HttpContext.Current.Session.SessionID); } }
private void SaveSessionInDB() { SessionValue _objSessionValue = null; HttpContext.Current.Request.Path.ToString(); TributesPortal.Utilities.StateManager stateManager = StateManager.Instance; _objSessionValue = (SessionValue)stateManager.Get("objSessionvalue", StateManager.State.Session); if (!Equals(_objSessionValue, null)) { if (_objSessionValue.UserId > 0) { UsersController _controller = new UsersController(); _controller.SessionStore(_objSessionValue, HttpContext.Current.Session.SessionID); } } }
protected void Page_Unload(object sender, EventArgs e) { SessionValue _objSessionValue = null; HttpContext.Current.Request.Path.ToString(); TributesPortal.Utilities.StateManager stateManager = StateManager.Instance; _objSessionValue = (SessionValue)stateManager.Get("objSessionvalue", StateManager.State.Session); if (!Equals(_objSessionValue, null)) { if (_objSessionValue.UserId > 0) { UsersController _controller = new UsersController(); _controller.SessionStore(_objSessionValue, HttpContext.Current.Session.SessionID); } } }