failed-to-load-viewstate

How to avoid 'Failed to load viewstate' exception when adding markup to a repeater?

I have a custom control that inherits from Repeater. I need to inject some markup around the items within the repeater. Currently im looping around Repeater.Items (OnPreRender) and adding LiteralControls containing the markup. This works great except for when performing a postback, as it throws the 'Failed to load viewstate' exception. ...

Setting ViewStateUserKey gives me a "Validation of viewstate MAC failed" error

I have the following in my BasePage class which all my ASPX pages derive from: protected override void OnInit(EventArgs e) { base.OnInit(e); ViewStateUserKey = Session.SessionID; } I also have a machineKey set in Web.config. I don't think this error is because of a web farm because this happens on my dev machine too. My host ...

Problem with LoadViewState after F5 page refresh - Failed to load viewstate

I'm having a problem in my ASP.NET application with Viewstate and F5 page refresh. If after navigating from one page to another I immediately hit F5, I get the following error: System.InvalidCastException "Unable to cast object of type 'System.Web.UI.Triplet' to type 'System.Web.UI.Pair'." This leads to the following exception disp...

Listview Cancel/Update causes Failed Veiwstate Error

I am utilizing a asp.net Listview control which is causing a Failed to load viewstate error after a row is put in edit mode and the user clicks either update or cancel. The ListView control is in an ascx User control that is hosted in a parent aspx page. The parent aspx code-behind calls the a bind method on the ascx page which in tu...

"Cannot load ViewState" after dynamic control changed

In my ASP.NET page I have to dynamically choose and load a custom control, depending on the selected value in a dropdownlist.However I encountered the following problem: When the parameters of the dynamically loaded control are changed, and then the selection in the dropdownlist is changed( thus forcing me to load a different dynamic con...

Failed to load viewstate with a composite control

I have created a composite control that changes the controls in it based on the value of one of it's properties called "Type". The intent is that once this "Type" property is set, it is not changed again for the life of the control, so the controls rendered as a result of the value of the "Type" property should not change. I have overri...