| HokieRTP 2005-06-27, 5:51 pm |
| I have a Web User Control that contains a datagrid with the paging being
utilized. I dropped this control on a template we need and everything is
fine except when a user clicks on the page number hyperlink on the datagrid.
When the page number hyperlink is clicked the first time, the page refreshes
and stays on page 1. When the page number hyperlink is clicked the second
time, I receive an error stating the following:
"Failed to load viewstate. The control tree into which viewstate is being
loaded must match the control tree that was used to save viewstate during the
previous request. For example, when adding controls dynamically, the
controls added durig a post-back must match the type and position of hte
controls added during the initial request."
I confirmed that there was data to display on the next page.
I dropped this same control on a non-template page and the page hyperlinks
on the datagrid worked correctly.
I checked the source code and saw that the page number hyperlinks call the
_doPostBack method and the information there appeared the same as the Source
Code on the non-template page.
Any thoughts or suggestions?
TIA
|