ViewState error using SignOutButton.ascx in web part

Chase Witt asked on August 6, 2014 23:20

I have created a custom web part. Within this web part I have Registered the SignOutButton control. <%@ Register Src="~/CMSWebParts/Membership/Logon/SignOutButton.ascx" TagName="SignOutButton" TagPrefix="signOut" %>

I then use the control like this... <span class="pull-right"><signOut:SignOutButton ID="mySignOutButton" runat="server" SignOutText="Sign Out" ShowAsLink="true" ShowOnlyWhenAuthenticated="true" /></span>

The control renders just fine and the SetupControl() event of the SignOutButton.ascx fires. However, when I click on the button to actually signout I get...

The state information is invalid for this page and might be corrupted.

[ArgumentNullException: Value cannot be null.
Parameter name: inputString]
   System.Web.UI.ObjectStateFormatter.Deserialize(String inputString, Purpose purpose) +9869839
   System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter2.Deserialize(String serializedState, Purpose purpose) +8
   System.Web.UI.Util.DeserializeWithAssert(IStateFormatter2 formatter, String serializedState, Purpose purpose) +40
   System.Web.UI.HiddenFieldPageStatePersister.Load() +127

[ViewStateException: Invalid viewstate. 
    Client IP:
    Port: 58957
    Path: /CMSPages/PortalTemplate.aspx
    User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36
    ViewState: ]

[HttpException (0x80004005): The state information is invalid for this page and might be corrupted.]
   System.Web.UI.ViewStateException.ThrowError(Exception inner, String persistedState, String errorPageMessage, Boolean macValidationError) +198
   System.Web.UI.HiddenFieldPageStatePersister.Load() +266
   System.Web.UI.Page.LoadPageStateFromPersistenceMedium() +88
   System.Web.UI.Page.LoadAllState() +36
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6704
   System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +245
   System.Web.UI.Page.ProcessRequest() +72
   System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +21
   System.Web.UI.Page.ProcessRequest(HttpContext context) +58
   ASP.cmspages_portaltemplate_aspx.ProcessRequest(HttpContext context) in c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\2795338d\b30b2295\App_Web_portaltemplate.aspx.67ab7734.j46ucyjy.0.cs:0
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +341
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69

Recent Answers

Matthieu Babef answered on October 27, 2014 16:08

Any ideas?

0 votesVote for this answer Mark as a Correct answer

Martin Danko answered on November 28, 2014 18:01


I'm not sure what exactly are you also doing in the code of your web part but I would recommend you to check the following articles:


Best regards, Martin

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.