I have a user control (.ascx) file. I am dynamically loading contents of this user control & want to write it to a StringWriter.
but i am getting this error :
Length of String constant exceeds current memory limit. Try splitting the string into multiple constants
The line of code which is causing the problem is :
UserControl viewControl = (UserControl)pageHolder.LoadControl(path);
The ascx control file size is not that big. (Almost 3 MB in size because it has some embedded images, fonts via Inline CSS).
Is there any way, I can increase the memory limit for this operation or any work around ?. I can think of adding the style sheet to string writer in a separate operation. but if there is some configuration to increase the memory limit I would be happy to use it.