Question

In an ASP.NET Web application, I have a page with an update panel. In this updatepanel, the user can click on an icon to add or remove controls to a repeater.

I put a breakpoint in the Page.Load of the updatepanel and checked the HttpContext.Current.Request.ContentLength every time the updatepanel is used. The request increases in size every time a request is sent.

The funny thing is that it even increases in size when the user removes the controls (so the page becomes 'lighter' again).

In the end, this gives me the following error: maximum request length.

The solutions around the web suggest to increase the maximumRequestLength. This is not an option because I'll reach the maximum anyway.

I've even noticed the request length increases exponentially.

Anyone had the same experience?

Was it helpful?

Solution

you are probably constantly adding attributes to your controls. Something like on page_prerender buttonSave.Attributes("onclick") += "this.className='buttonhide';"

OTHER TIPS

Off the top of my head, it sounds like you could be hitting a ViewState issue here. If the length is increasing regardless of what's happening, I suspect that items are being added into the ViewState and not removed. The funny thing is, a lot of times you don't need ViewState, but people leave it turned on.

Sounds like you have static reference at the request level. I have seen this before in a base page. What happens is that nothing can be disposed and it just grows and grows.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top