Note Session Expired in CallBack Panel

Is there an easy way to determine on a callback that the session has expired, and if so redirect the user to a login page? On post back it is fairly trivial to check for the existence of session variable and then redirect. However, on callback redirect is not possible. I was looking into using a pop up window to provide the link, but how do I open a pop up from the server side code where I check my session variables from?


1 Reply

JA Janagan Syncfusion Team May 12, 2008 01:27 PM UTC

Hi Mark,

You can determine on a callback that the session has expired by the Aftercallbackresponsescript as mentioned in the code below:


protected void CallbackPanel1_CallbackRefresh(object sender, CancellableCallbackEventArgs e)

{

{
if (Context.Session.Timeout!=null)
{
//Session["ISTIMEOUT"] = false;
string szCookieHeader = Request.Headers["Cookie"];
if (Session.IsNewSession)
{
if ((null != szCookieHeader))
{
CallbackPanel1.AfterCallbackResponseProcessedScript = "window.location.rel='nofollow' href= 'Default.aspx'";
}
}
}

}
}



Please refer the sample in the link below which illustrates the above:

http://websamples.syncfusion.com/samples/Tools.Web/6.2.0.40/Tools_ASP_Logon/main.htm


Please try running this and let me know if this helps.

Regards,
Janagan.



Loader.
Up arrow icon