Good Day All
I have a web Method defined like this
Code:[System.Web.Services.WebMethod] public static bool CheckSessionExpiration() { System.Web.HttpContext.Current.Session["CurrentLoginUser"] = null; //This is for Testing Purpose if (UserSecurity.GetLoggedInUser() == null) { return false; } else { return true; } }
and in Jquery i have a function that calls this
function ProcessAction() {
and i have a Callback function defined like thisCode:PageMethods.CheckSessionExpiration(OnCheckSessionExpirationComplete, OnCallError); if (IsLogin == true) { alert("Inside the Function"); var txtNote = $("[id$=txtNote]").val(); var txtIdentNo = $("[id$=txtIdentNo]").val(); var sIdentNo = ""; DisableControls(); CleanIdentNoList(); if (ValidFields()) { //Get Subscriber Detail gAction = $("[id$=cmbAction]").val(); gNote = txtNote; sIdentNo = jQuery.trim(txtIdentNo); gMSISDNList = sIdentNo.split("\n"); gMSISDNIndex = -1; ProcessNextItem(); } else { EnableControls(); } } else { window.location = "Login.aspx"; } }
Now the "IsLogin" variable is a Global variable defined like thisCode:function OnCheckSessionExpirationComplete(result,methodName) { if (result == false) { IsLogin = false; } else { IsLogin = true; } }
What i want to do is to redirect the user if the Session is null, as you can see i have added the lineCode:var IsLogin = true;
For testing Purpose , but my problem is is that, even if its null, theCode:System.Web.HttpContext.Current.Session["CurrentLoginUser"] = null; //This is for Testing Purpose
is fired, what i am i doing wrong.Code:alert("Inside the Function");
THanks


Reply With Quote
