Login  
Search All Forums
Dart Home | PowerWEB LiveControls for ASP.NET | Custom Development Reply | PowerWEB LiveControls for ASP.NET Topics | Forums   
AuthorForum: PowerWEB LiveControls for ASP.NET
Topic: Viewstate Problem
wombel

From: Nürnberg, Germany
Posts: 55
Member Since: 09/22/05
posted June 6, 2007 4:27 AM

Hi,

we are runnning LC 1.6 ASP.NET 2.0 and are having trouble with ViewState Cache.

Our web.config contains the following entries:

<add key="Dart.PowerWEB.LiveControls.ViewStateCacheTimeout" value="120"/>
<add key="Dart.PowerWEB.LiveControls.ViewStateCacheEnabled" value="true"/>

The error, we receive is the following:
Message : The server ViewState cache has timed out.
The application was unable to successfully recover state.
To address this exception, modify your web.config to use client-side viewstate caching,
or to extend the server cache timeout value.<br/> source: Dart.PowerWEB.LiveControls<br/>
StackTrace:  at Dart.PowerWEB.LiveControls.r.e(EventArgs A_0)  at Dart.PowerWEB.LiveControls.LiveTimer.OnLoad(EventArgs e)  
at System.Web.UI.Control.LoadRecursive()  at System.Web.UI.Control.LoadRecursive()  
at System.Web.UI.Control.LoadRecursive()  at System.Web.UI.Control.LoadRecursive()  
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)<br/>
Error occurred in page : /ProfileEdit.aspx

Can you help me with this one?

TIA
Wombel
John Talarico



From: Rome, NY USA
Posts: 630
Member Since: 06/01/05
posted June 7, 2007 5:40 PM

Wombel:

Is there any other information you could provide, such as what controls are being used, what activities are being performed, etc?

Whatever details you can fill in regarding how to reproduce this behavior would be helpful.

Thanks,
John
wombel

From: Nürnberg, Germany
Posts: 55
Member Since: 09/22/05
posted June 12, 2007 7:39 AM

Well, the reason might be a LiveTimer we implemented into the masterpage.

Here is the .aspx code:
<%@ Register Assembly="Dart.PowerWEB.LiveControls" Namespace="Dart.PowerWEB.LiveControls" TagPrefix="cc1" %>

...........
  <form id="form1" runat="server" >
  <cc1:LiveTimer ID="timerUpdateOnline" runat="server" Interval="480000"></cc1:LiveTimer>

........

And here is the .vb code:
Imports System.Globalization
Imports System.Threading
Imports Waslos.Profile.BLL

Partial Class Masters_PageMaster
  Inherits System.Web.UI.MasterPage

  Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    If Not IsPostBack Then
      timerUpdateOnline.Start()
    End If
   
  End Sub

  Protected Sub timerUpdateOnline_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles timerUpdateOnline.Tick
    If HttpContext.Current.User.Identity.IsAuthenticated Then
      userBL.UpdateUserOnlineTime(CInt(Session("UserID")))
    End If
  End Sub
End Class
John Talarico



From: Rome, NY USA
Posts: 630
Member Since: 06/01/05
posted June 12, 2007 4:30 PM

Have you confirmed that this issue does not exist if the LiveTimer is placed on the Child page instead of the Master Page?
wombel

From: Nürnberg, Germany
Posts: 55
Member Since: 09/22/05
posted July 4, 2007 8:41 AM

John,
we played around with it a bit, removed the timer, but that did not help. Our problem now is, that we cannot locate the source of the problem. The error allways occurs after the application was not used for a while. The timespan seems to vary.
wombel

From: Nürnberg, Germany
Posts: 55
Member Since: 09/22/05
posted August 10, 2007 7:07 AM

Any idea? We need to solve this.... Any help apprechiated...
John Talarico



From: Rome, NY USA
Posts: 630
Member Since: 06/01/05
posted August 10, 2007 8:59 AM

Wombel:

I apologize for the delay. We still haven't been able to replicate the problem, and from your last posts it doesn't seem as if you are able to narrow down the specific failure conditions either. 

Perhaps I can shed some light on the way the ViewStateCache mechanism operates. In order to prevent often costly resubmission of encoded ViewState data, LiveControls caches the data on the server and uses a unique identifier (what we call a PageKey) in each callback to reestablish the encoded ViewState.

So, when this exception is raised it means the supplied PageKey in a callback fails to match up with any cached ViewState data. This can occur if the PageKey is somehow corrupted, or if the page's cache entry is removed.  

Are you globally clearing out the application cache anywhere in your website?

Is your application hosted on a server farm where individual requests may not be handled by the same server? If so, this could exhibit the same behavior as a cleared cache.

Do you have other HttpModules in your application besides the LiveControls CallbackManager that may be altering the request and somehow interfering/altering the PageKey?

If all else fails and you still cannot determine the contributing factors, you may turn off the ViewStateCache mechanism by setting ViewStateCacheEnabled to "false".
wombel

From: Nürnberg, Germany
Posts: 55
Member Since: 09/22/05
posted August 10, 2007 9:06 AM

John,

thanks for your reply. The only other product we use that I can think of causing a problem is ASP.NET Ajax. Are the any known issues?

Thanks
Wombel
John Talarico



From: Rome, NY USA
Posts: 630
Member Since: 06/01/05
posted August 10, 2007 9:21 AM

ASP.NET Ajax does employ HttpModules and there's a possibility that they may be causing some interference, but we haven't received any reports of such issues.

Just to be safe, check the web.config httpModules section and make sure the LiveControls CallbackManager is first in the list. The order they appear is the order they handle request data. The CallbackManager was designed to perform its ViewStateCache operations and pass on the request to the next module in the pipeline.
Reply | PowerWEB LiveControls for ASP.NET Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX