I have a project that generates reports in html string format. Then I attach this string to a label or literal and works great.
The problem is.. when the report is too big, around (27k records), I get the System.OutofMemoryException and this error occurs exactly in the last line:
Label1.text = totalStringBuilderHtml.ToString()
The program is able to generate around 300k records before I get this exception on the StringBuilder.. and the DOM can renderize up to 216k records using clone() and append() on the first 27k.
So, Is there another way to open this big Html string from server to client in asp.net ?
EDIT: Now it is generating up to 70k records, using a div on a client side, filling it with a JavaScript function and using a ScriptManager to call it.
<asp:ScriptManager ID="ScriptManager1" EnablePageMethods="true" EnablePartialRendering="true" runat="server" />
<div id="divContent"> </div>
Script:
function renderContent(text) {
document.getElementById('divContent').innerHTML = text;
};
Calling the script on code:
myPage.ClientScript.RegisterStartupScript(myPage.GetType(), "rendering", "renderContent(' " + totalStringBuilderHtml.ToString() + " ');", True);
But the DOM can take 3 times more, how can I hit this limit before getting the System.OutOfMemoryException ?