an ASP.NET Open Source CMS & eCommerce platform
Search:
Skip Navigation LinksHome > DotShoppingCart Forums > Support > Using DotShoppingCart > Add new Product - Failed to load viewstate
Last Post 5/21/2010 2:04:29 AM By Applied. 6 replies.
5/5/2010 4:49:56 AM
Applied
Posts: 93
Joined: 9/18/2009
Add new Product - Failed to load viewstate
On our deployed web site, one of the users get this message when attempting to add a new product with the 'add' button (add via wizard is ok).
 
<span style="font-size: 14pt; color: maroon; font-family: 'Verdana','sans-serif'">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.</span>
 
When we try the same thing on the same site we do not get an issue.
 
Have you come across this before?
 
5/5/2010 10:05:31 AM
lukezy
Posts: 2109
Joined: 6/12/2007
Location:WA, US
Re: Add new Product - Failed to load viewstate
He might have a stale session. Ask him to log off and log back in.
DotShoppingCart Staff
5/5/2010 10:23:03 AM
Applied
Posts: 93
Joined: 9/18/2009
Re: Add new Product - Failed to load viewstate
No - this occurs in admin mode, as soon as 'add' is clicked to add a new product after starting up the browser. But if we do it (same database/same web site) it works. Could there be some analytics or toolbar interfering with it?
5/5/2010 11:03:12 AM
lukezy
Posts: 2109
Joined: 6/12/2007
Location:WA, US
Re: Add new Product - Failed to load viewstate
Yes, it might. Which browser does he use? Have he tried other browser?
DotShoppingCart Staff
5/6/2010 2:42:05 AM
Applied
Posts: 93
Joined: 9/18/2009
Re: Add new Product - Failed to load viewstate
Other browsers and/or machines have the same issue.
 
I notice that in ProductEdit.aspx.cs that the FillFormArguments method is used. I wonder if this has a bearing on things. Do the 'values' in FillFormArguments have to be added in a specific order?
 
I also notice that I can get a 'failed to load viewstate' error if for example I navigate straight to the product edit page using these steps:
 
(1) start browser
(2) paste in URL such as "http://testsite.appliedss.co.uk/Admin/Catalog/ProductEdit.aspx" 
(3) sign in when system asks 
(4) click 'add' to the right of the category dropdown
 
 
 
5/6/2010 10:00:43 AM
lukezy
Posts: 2109
Joined: 6/12/2007
Location:WA, US
Re: Add new Product - Failed to load viewstate
I cannot repro what you described here. Is this user having the problem or everyone?
DotShoppingCart Staff
5/21/2010 2:04:29 AM
Applied
Posts: 93
Joined: 9/18/2009
Re: Add new Product - Failed to load viewstate
Resolved this by rejigging some code. I think there was intermittent problems caused by setting the page size of the grid. This only seemed to cause an error on the remote server for some reason.