I've been working on a handful of ASP.NET user controls which will be integrated into a Sitecore CMS instance. Development has been completed using some dummy aspx pages to host the controls and everything works fine locally and when the project is deployed onto a test server.
However, when we integrate the modules into Sitecore a few actions cause an 'Invalid Viewstate' exception - 'Invalid character in base64 string'. I have replicated this locally, i.e. on my dev system, by configuring IIS to look at the Sitecore project so this leads me to believe that it is not a server issue but obviously I can't be sure of that.
Using fiddler I can see that the POST request contains not one but two __VIEWSTATE fields, indeed __EVENTVALIDATION, __EVENTTARGET and __EVENTARGUMENT have two instances each in the request. The __VIEWSTATE values are identical and I can decode the content (hence I assume that the failure is due to the presence of two values, not an error in either one of them). The two __EVENTVALIDATION values are different but both are valid (i.e. they decode) and the other __EVENT fields are empty.
If I remove the UpdatePanels from the control then eveything works 'OK' - obviously there are no AJAX partial page updates now though which is not ideal. If I disable Jscript in my browser with the UpdatePanels back in the code, then again everything is 'OK'.
Can anyone shed some light on this or point me in the right direction - I'm out of ideas now and if I can't sort it I'll have to remove the UpdatePanels and see if we can live with the result, not ideal.
[Update 14-02-2012] I've been trawling the web but have not really found anyone with the same problem. I thought I'd struck gold with this post but again it made no difference to my problem. All indications are that AJAX on Sitecore should work fine but so I'm guessing that we must have a configuration problem. Problem is that I'm not a Sitecore developer and currently I don't have access to one (annual leave!)