Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1220
grid OutOfMemory exception while paging (clicking on a page #)
posted

hello, 
i have a basic pager configuration and experiencing some problems. When page size is 500, the grid appears to be freezing the browser.

but my main problem as of now, is that when i set the page size to 100, i get OutOfMemoryException.

here is my page configuration:

                this.DisplayLayout.Pager.AllowPaging = true;
                this.DisplayLayout.Pager.PageSize = this.PageSize.Value;
                this.DisplayLayout.Pager.Alignment = PagerAlignment.Center;
                this.DisplayLayout.Pager.PagerStyle.CssClass = "caption gridpagerlinks";
                this.DisplayLayout.Pager.PrevText = "Previous";
                this.DisplayLayout.Pager.NextText = "Next";
                this.DisplayLayout.EnableInternalRowsManagement = true;

here is the full exception i get after clicking on page #33 (out of 73). It appears that viewstate serializer fails? 

System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown. at System.String.GetStringForStringBuilder(String value, Int32 startIndex, Int32 length, Int32 capacity) at System.Convert.ToBase64String(Byte[] inArray, Int32 offset, Int32 length, Base64FormattingOptions options) at System.Web.UI.ObjectStateFormatter.Serialize(Object stateGraph) at System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter.Serialize(Object state) at System.Web.UI.Util.SerializeWithAssert(IStateFormatter formatter, Object stateGraph) at System.Web.UI.HiddenFieldPageStatePersister.Save() at System.Web.UI.Page.SavePageStateToPersistenceMedium(Object state) at System.Web.UI.Page.SaveAllState() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) ,

 

  • 1220
    posted

    this is an issue with viewstate deserialization. since this is a grid with 7700 rows, postback is not handling the huge grid.. 

    one solution i can think of is overriding viewstate handling and not dumping it into __viewstate field on the page.. 

    any other ideas?