Failed to load viewstate

  • Thread starter Thread starter Ariel Gimenez
  • Start date Start date
A

Ariel Gimenez

Hello,
Can someone helpme?
I have a datagrid in wich im using column templates for the edit command, with comboboxes.
The datagrid works fine for the first time i execute the edit command but the second time it gives me the following error...

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 during a post-back must match the type and position of the controls added during the initial request.

any help will be appreciated
Thanks in adfance
Ariel Gimenez
 
Your post went unanswered. Have you resolved this issue?

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
Hello,
Can someone helpme?
I have a datagrid in wich im using column templates for the edit command, with comboboxes.
The datagrid works fine for the first time i execute the edit command but the second time it gives me the following error...

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 during a post-back must match the type and position of the controls added during the initial request.

any help will be appreciated
Thanks in adfance
Ariel Gimenez
 
I think you have to disable the hidden field __VIEWSTATE before re-submitting..

Show generated source code by rightclicking your page in the browser and look the hidden "__VIEWSTATE"

Replace your button with a simple HTML Button
Add javascript code for onClick

function myButton_onclick(){
window.document.myForm._VIEWSTATE.Disabled=true;
window.document.myForm.target = "TargetFrame"; // (if needed)
window.document.myForm.Action = "Other aspxPage"; // (if needed)
window.document.myForm.submit();
}

"Alvin Bruney [MVP]" <vapor at steaming post office> a écrit dans le message de news: (e-mail address removed)...
Your post went unanswered. Have you resolved this issue?

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
Hello,
Can someone helpme?
I have a datagrid in wich im using column templates for the edit command, with comboboxes.
The datagrid works fine for the first time i execute the edit command but the second time it gives me the following error...

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 during a post-back must match the type and position of the controls added during the initial request.

any help will be appreciated
Thanks in adfance
Ariel Gimenez
 
Back
Top