Reputation: 1471
I am creating one application in which I need to render approx. 10K record in single page inside DataList. DataList contains html controls only and not .net controls.
this.dlData.DataSource = data;
this.dlData.DataBind();
Based on above code, I am just simply binding it and it is throwing below error.
I am not sure what is being missed. If anyone have any idea, then it would be really appreciated.
Please note - I don't want to rewrite code in other client side framework like jQuery, Angular, Kendo and etc as we have to change so many things and we have release in place so.
Thanks in Advance!
Upvotes: 0
Views: 109
Reputation: 7803
I can't even imagine why you would need to render 10K records into a single page but the error suggests you are using view state and the list is too large for the capacity when trying to serialize the state of the control.
Try turning off view state on the page:
<%@ Page Language="C#" EnableViewState="false" %>
You can read more about View State here.
View State is the method to preserve the Value of the Page and Controls between round trips. It is a Page-Level State Management technique. View State is turned on by default and normally serializes the data in every control on the page regardless of whether it is actually used during a post-back.
Upvotes: 0