RE: CompositeDataBoundControl and "Failed to load viewstate"
- From: wawang@xxxxxxxxxxxxxxxxxxxx (Walter Wang [MSFT])
- Date: Fri, 23 Mar 2007 08:43:04 GMT
Hi,
Using Dino's sample
http://localhost/ProAspNetAdv/Samples/Ch14/BarChart/TestBarChart.aspx for
example, if you add a breakpoint in BarChart.cs: CreateControlHierarchy:
after the barchart gets loaded, click "Just post back": you will notice the
"dataBinding" is false but "dataSource" contains 9 null item in an array.
This 9 is returned in previous call to this CreateControlHierarchy when
"dataBinding" is true. In this case, although the data is null, but the
BarCharItems still get created correctly.
As far as I know, DataBind() must be called for the
CompositeDataboundControl since it's not saving state into ViewState.
I understand Dino's BarChart example is not similar to your case since your
control has EditMode. Do you think it's very much like the FormView or
DetailsView (which are also inherited from CompositeDataboundControl). You
might want to take a look at their implementation using Reflector
(http://www.aisto.com/roeder/dotnet/).
Regards,
Walter Wang (wawang@xxxxxxxxxxxxxxxxxxxx, remove 'online.')
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
.
- Follow-Ups:
- RE: CompositeDataBoundControl and "Failed to load viewstate"
- From: Walter Wang [MSFT]
- RE: CompositeDataBoundControl and "Failed to load viewstate"
- References:
- RE: CompositeDataBoundControl and "Failed to load viewstate"
- From: Walter Wang [MSFT]
- RE: CompositeDataBoundControl and "Failed to load viewstate"
- Prev by Date: RE: CompositeDataBoundControl and "Failed to load viewstate"
- Next by Date: ITemplate and ControlBuilder
- Previous by thread: RE: CompositeDataBoundControl and "Failed to load viewstate"
- Next by thread: RE: CompositeDataBoundControl and "Failed to load viewstate"
- Index(es):
Loading