Failed to load viewstate

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
 
A

Alvin Bruney [MVP]

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
 
L

Laurent Jordi

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top