This is a migrated thread and some comments may be shown as answers.

Session Timeout on Ajax Enabled Pages - Response.RedirectLocation not working

6 Answers 228 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
amonte
Top achievements
Rank 1
amonte asked on 19 Aug 2011, 10:28 PM
We seem to be having a common problem with our web application; specifically that when the user attempts to click on a RadGrid, RadTabStrip or any other ajax enabled component on the page after the session has expired, an error occurs.  This is the specific error:

Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 12030


I've done several searches on this topic, and one of the solutions that was recommended was to set the  Response.RedirectLocation property in the Login page.  I have tried this to, but I have still been unsuccessful.

As a workaround, I added a timer to my master page.  My goal was to set the interval of the timer for the 15 minute session life and than automatically redirect the user to the Login page.  The only problem is I cannot reset the timer if the user remains active, so it simply expires in 15 minutes (or whatever interval it is set to) whether the user is active or not.  I am trying to use the following code to reset the timer:

protected void Page_Load(object sender, EventArgs e)
{
    SessionTimer.Enabled = false;
    SessionTimer.Interval = 30000;
    SessionTimer.Enabled = true;
}

The code is being called, but it is not effecting the timer. 

Any ideas on how to implement this solution?

Thanks,
Jerry


6 Answers, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 24 Aug 2011, 03:44 PM
Hello Jerry,

I would suggest you to refer to the following forum thread which elaborates on this matter and provide several approaches. The post is actually for the old classic RadControls however as the issue is generic MS Ajax issue and not specific RadAjax issue the same should help in your application.

Greetings,
Maria Ilieva
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
amonte
Top achievements
Rank 1
answered on 29 Aug 2011, 04:09 PM
Maria,

Thank you for your response, but once again, this solution does not work.

Based on the contents of this thread, I tried the following code in my Logon.aspx Page_Init

Response.RedirectLocation = Request.Url.ToString();

But just as I described in my first post, I still get the following error:

Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 12030


Please advise.

Regards,
Jerry
0
Stacy
Top achievements
Rank 1
answered on 18 Oct 2011, 03:54 PM
I would like a reply as well as I also have this issue, and apparently many others, and the solution provided does nothing.
0
Maria Ilieva
Telerik team
answered on 20 Oct 2011, 10:16 AM
Hello Stacy,

As I mentioned in my previous post the mentioned issue is actually a generic MS Ajax issue and is not directly related to RadAjax. Please let me know if the same issue appear when using regular asp UpdatePanels. As soon as a fix could be applied for scenario with regular asp UpdatePanels the same will be applicable with RadAjax controls.

All the best,
Maria Ilieva
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Stacy
Top achievements
Rank 1
answered on 21 Oct 2011, 02:09 PM
When I put "Response.RedirectLocation = Request.Url.ToString();" into my login page "Page_Init" function, i do not get a MS error when the session times out, nor do i get redirected to the login page (which is what i want)....instead my grid refreshes with 0 rows (as if datasource is null), then if i perform an action again, the grid reloads with data.  There is no redirect, which is what i want.
0
Maria Ilieva
Telerik team
answered on 26 Oct 2011, 12:00 PM
Hello Stacy,

Have you tried using the RadAjaxManager.Redirect() method in order to redirect the page. If not, please give this a try and let me know how it goes.

Regards,
Maria Ilieva
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
Ajax
Asked by
amonte
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
amonte
Top achievements
Rank 1
Stacy
Top achievements
Rank 1
Share this question
or