Question

I'm writing a pretty complex web form using ASP.NET Dynamic Data. Several of the controls on this form post back, since there are dependencies between controls. I'm noticing that the viewstate is growing larger with every postback, until after 5 or so there is a long delay between the Render process and the page actually loading in the web browser.

This occurs even if I'm JUST clicking a radio button to cause the postback, without entering any data or any other changes into the form...

I checked the older version of the form, which does not use Dynamic Data, and the viewstate doesn't grow at all... so I'm theorizing that the dynamic data controls are somehow to blame...

Anyone else seen this? Is there a fix for it?

Was it helpful?

Solution 2

Ok, so the culprit was Telerik's RadComboBox. More specifically, it was the lack of support for Dynamic Data using RadComboBox. To be even MORE specific:

The workaround for using a RadComboBox with DynamicData is to have a DropDownList with visible set to false, call the PopulateListControl on that DDL and then copy the items to RadComboBox.

This works fine, except when you do that on every postback... I'm guessing it stuffs the entire list into Viewstate when you do it that way, and since I was doing it every postback... the viewstate kept growing.

OTHER TIPS

I don't know the direct answer to your question, but perhaps one of these tools may help you diagnose further:

(1) Fritz Onion's ViewState Decoder tool might be able to help you figure out what's getting stuffed in there. You can find ViewSate Decoder listed at the Pluralsight Tools page. Direct download link: ViewStateDecoder22.zip.

ViewState Decoder screen shot http://alt.pluralsight.com/images/decoderscreenshot.gif

(2) Another tool that may be worth looking at is ASP.NET ViewState Helper:

"[...] ASP.NET ViewState Helper is designed to help all web developers, but has specific features to help ASP.NET developers debug ViewState issues. Analyze your web pages in real-time while you browse them using Internet Explorer 6.0 or higher. [...]"

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