Wednesday, June 24, 2020

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

For this issue you can try this code.

   protected override PageStatePersister PageStatePersister
    {
        get
        {
            return new SessionPageStatePersister(this);
        }
    }

This overrides the normal page state persister and provides one that persists the page data to the Session instead of the ViewState and please make sure that if the property of any control by force is true make it false otherwise issue will still remain same.

enableviewstate=false


Links:
Refer link

No comments:

Post a Comment