Search code examples
.netvb.netsyncfusion

Occasional NullReferenceException


Users get occasional error. I moved my application from 2003 server 32 bit 2.0 framework to 2012 server(on cloud) 64 bit 4.0 framework. Any help is appreciated.

< Exception Type =" System.NullReferenceException">
 < Message > Object reference not set to an instance of an object. </ Message > 
 < Source > Syncfusion.Grid.Grouping.Web </ Source > 
 < StackTrace > at Syncfusion.Web.UI.WebControls.Grid.Grouping.GridGroupingControl.LoadSourceListSet() at Syncfusion.Web.UI.WebControls.Grid.Grouping.GridGroupingControl.LoadViewState(Object savedState) at System.Web.UI.Control.LoadViewStateRecursive(Object savedState) at System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) at System.Web.UI.Control.LoadViewStateRecursive(Object savedState) at System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) at System.Web.UI.Control.LoadViewStateRecursive(Object savedState) at System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) at System.Web.UI.Control.LoadViewStateRecursive(Object savedState) at System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) at System.Web.UI.Control.LoadViewStateRecursive(Object savedState) at System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) at System.Web.UI.Control.LoadViewStateRecursive(Object savedState) at System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) at System.Web.UI.Control.LoadViewStateRecursive(Object savedState) at System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) at System.Web.UI.Control.LoadViewStateRecursive(Object savedState) at System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) at System.Web.UI.Control.LoadViewStateRecursive(Object savedState) at System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) at System.Web.UI.Control.LoadViewStateRecursive(Object savedState) at System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) at System.Web.UI.Control.LoadViewStateRecursive(Object savedState) at System.Web.UI.Page.LoadAllState() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) </ StackTrace > 
 < Data /> 
 </ Exception > 

Solution

  • We restore some state from session to ViewState in gridgroupingcontrol. Whenever the IIS is recycled, then the session will lost and it causes your updated issue. In web, the session will not expire for we refreshing the session continuously, but if you recycle the IIS which we cannot handle, the session must be expired.

    To resolve this, check whether session is expired. If yes, your page redirect to the login page, after re-login, add a flag parameter to the address need to restore. In the pageload, try to get the flag parameter.

    I hope it helps to you.

    If the solution does not help you, could you please share me more information about it or share your sample code.