From: SureshKumar Ganapathy on

change the Enctype to "application/x-www-form-urlencoded"

<form id="Form1" method="post" runat="server" enctype="application/x-www-form-urlencoded">

It works for me.

Download the Tool Fiddler. It will get you what viewstate has before and after the page is posted.

> On Wednesday, April 02, 2008 2:16 AM Benny Ng wrote:

> Dear All,
>
> I got the following error today. But yesterday this application is
> running fine.
>
> Even today i try to move this project to another server. The same
> symptom I got.
>
> Does anyone know what's happened for this case?
>
> Thanks,
>
> Best Regards,
>
> Benny Ng
>
>
>
>
>
>
>
> Server Error in '/LGOldServices' Application.
> --------------------------------------------------------------------------------
>
> The state information is invalid for this page and might be corrupted.
> Description: An unhandled exception occurred during the execution of the
> current web request. Please review the stack trace for more information
> about the error and where it originated in the code.
>
> Exception Details: System.Web.HttpException: The state information is
> invalid for this page and might be corrupted.
>
> Source Error:
>
>
> [No relevant source lines]
>
>
> Source File: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
> Files\lgoldservices\10b99f4d\fe7b353e\App_Web_jlz_zk70.4.cs Line: 0
>
> Stack Trace:
>
>
> [FormatException: Invalid character in a Base-64 string.]
> System.Convert.FromBase64String(String s) +0
> System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) +67
> System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter.Deserialize(String
> serializedState) +4
> System.Web.UI.Util.DeserializeWithAssert(IStateFormatter formatter,
> String serializedState) +37
> System.Web.UI.HiddenFieldPageStatePersister.Load() +136
>
> [ViewStateException: Invalid viewstate.
> Client IP: 192.168.0.60
> Port: 2962
> User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2; .NET CLR
> 1.1.4322; InfoPath.2; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR
> 3.0.04506.648; .NET CLR 3.5.21022)
> ViewState:
> /wEPDwUKLTMyNjMzMDc2Mw8WAh4PU2VydmljZU9iamVjdElkBQwxMDAwMDAwMDAwMDEWAgIDD2QWdgIBDw8WAh4EVGV4dAUM5pyN5Yqh5a+56LGhZGQCAw8PFgIfAQUM5Z+65pys6LWE5paZZGQCBA8PFgIfAQUG56S+5Yy6ZGQCBQ8QDxYGHg5EYXRhVmFsdWVGaWVsZAUMQ29tbXVuaXR5X0lkHg1EYXRhVGV4dEZpZWxkBQlDb21tdW5pdHkeC18hRGF0YUJvdW5kZ2QQFQkM5paw55Sf56S+5Yy6DOWNl+iBlOekvuWMugzpvpnlspfnpL7ljLoM6b6Z5Lic56S+5Yy6D+m+meWyl+Win+ekvuWMugzljZfnuqbnpL7ljLoM5ZCM5LmQ56S+5Yy6DOW5s+WNl+ekvuWMugR0ZXN0FQkMMTAwMDAwMDAwMDAxDDEwMDAwMDAwMDAwMgwxMDAwMDAwMDAwMDMMMTAwMDAwMDAwMDA0DDEwMDAwMDAwMDAwNQwxMDAwMDAwMDAwMTMMMTAwMDAwMDAwMDE0DDEwMDAwMDAwMDAxNQwxMDAwMDAwMDAwMTYUKwMJZ2dnZ2dnZ2dnFgECBmQCBg8PFgIfAQUG5oCn5YirZGQCBw8QDxYGHwIFCVNleHVhbF9JZB8DBQZTZXh1YWwfBGdkEBUCA+eUtwPlpbMVAgwxMDAwMDAwMDAwMDkMMTAwMDAwMDAwMDEwFCsDAmdnZGQCCA8PFgIfAQUG5aeT5ZCNZGQCCg8PFgIfAQUP5Ye65...]
>
> [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) +267
> System.Web.UI.HiddenFieldPageStatePersister.Load() +218
> System.Web.UI.Page.LoadPageStateFromPersistenceMedium() +83
> System.Web.UI.Page.LoadAllState() +35
> System.Web.UI.Page.ProcessRequestMain(Boolean
> includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +7350
> System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint,
> Boolean includeStagesAfterAsyncPoint) +213
> System.Web.UI.Page.ProcessRequest() +86
> System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +18
> System.Web.UI.Page.ProcessRequest(HttpContext context) +49
> ASP.serviceobject_edit2_aspx.ProcessRequest(HttpContext context) in
> c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
> Files\lgoldservices\10b99f4d\fe7b353e\App_Web_jlz_zk70.4.cs:0
> System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
> +358
> System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
> completedSynchronously) +64
>
>
>
>
> --------------------------------------------------------------------------------
> Version Information: Microsoft .NET Framework Version:2.0.50727.1433;
> ASP.NET Version:2.0.50727.1433
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> And the following is the error message i got from Event Viewer.
>
>
> Event Type: Information
> Event Source: ASP.NET 2.0.50727.0
> Event Category: Web Event
> Event ID: 1316
> Date: 2008-4-2
> Time: 13:53:36
> User: N/A
> Computer: LG
> Description:
> Event code: 4009
> Event message: Viewstate verification failed. Reason: Viewstate was invalid.
> Event time: 2008-4-2 13:53:36
> Event time (UTC): 2008-4-2 5:53:36
> Event ID: eeaf78191240418aa9808d5ef214be54
> Event sequence: 20
> Event occurrence: 1
> Event detail code: 50204
>
> Application information:
> Application domain: /LM/W3SVC/1/Root/LGOldServices-1-128515892019218750
> Trust level: Full
> Application Virtual Path: /LGOldServices
> Application Path: D:\Projects.Net2008\LGOldServices\LGOldServices\
> Machine name: LG
>
> Process information:
> Process ID: 2752
> Process name: w3wp.exe
> Account name: NT AUTHORITY\NETWORK SERVICE
>
> Request information:
> Request URL:
> http://192.168.0.148/lgoldservices/ServiceObject/Edit2.aspx?Action=Edit&Id=100000000001
> Request path: /lgoldservices/ServiceObject/Edit2.aspx
> User host address: 192.168.0.60
> User:
> Is authenticated: False
> Authentication Type:
> Thread account name: NT AUTHORITY\NETWORK SERVICE
>
> ViewStateException information:
> Exception message: Invalid viewstate.
> Client IP: 192.168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o5L2/55So5pe25aaC5p6c5Y+q5oOz6K6+572u56ys5LqM5Liq5Y+C5pWwLOWImeimgeWcqOesrOS4gOS4quWPguaVsOS9jee9ruWGmeWFpW51bGwuZAJGDw8WAh8BBQblhbblroNkZAJHDxYCHwYFTU5leHQgc3RlcHMo5LiL5LiA5q2lKeaenOS9oOaDs+WBmuabtOWlveeahGphdmFzY3JpcHTlvIDlj5Es5bu66K6u5L2g5L2/55So5LiAZAJIDw8WAh8BBQzpq5jnuqfkv6Hmga9kZAJJDw8WAh8BBQbkurLlsZ5kZAJLDw8WAh8BBQnosIPmn6XlkZhkZAJNDw8WAh8BBQzosIPmn6Xml6XmnJ9kZAJOD2QWAgIFDw9kFgIfBQV2amF2YXNjcmlwdDpyZXR1cm4gcG9wVXBDYWxlbmRhcih0aGlzLFR4dFN1cnZleURhdGVfdHh0X0RhdGUsICdkZC9tbS95eXl5JywgJ19fZG9Qb3N0QmFjayhcJ1R4dFN1cnZleURhdGVfdHh0X0RhdGVcJyknKWQCTw8PFgIfAQUG5L+d5a2YZGQCUA8WAh4FdmFsdWUFBumHjeiuvmQCUQ8PFgIfAQUP5L+d5a2Y5bm26L+U5ZueZGRkKbcUSItP4ewSBWIYTPNOmqZbEeQ=,/wEPDwUKLTgyMDA0OTg5OA9kFgJmD2QWAgIFDxYEHgV2YWx1ZQUG5L+d5a2YHgdvbmNsaWNrBRNmbkluc2VydFJlbGF0aXZlKCk7ZBgBBR5fX0NvbnRyb2xzUmVxdWlyZVBvc3RCYWNrS2V5X18WAQUSQ2hrUmVsYXRpdmVGb3JzdGVypMFTFaw2gG+a5mrDrM7vaFmU2Qk=
> Referer:
> http://192.168.0.148/lgoldservices/ServiceObject/Edit2.aspx?Action=Edit&Id=100000000001
> Path: /lgoldservices/ServiceObject/Edit2.aspx
>
> Custom event details:
>
> For more information, see Help and Support Center at
> http://go.microsoft.com/fwlink/events.asp.


>> On Wednesday, April 02, 2008 6:37 AM Benny Ng wrote:

>> Now I know the reason of this problem.
>>
>>
>>
>> Because the page i want to submit is a main page. Through AJAX i got some
>> content from another page. But with the returned content. It's contained a
>> variable name "__VIEWSTATE". It will replaced the same variable of the main
>> page.
>>
>>
>>
>> So when i tried to submit the content of main page. The error i mentioned
>> will comes. Because the content of __VIEWSTATE of main page is replaced
>> already.
>>
>>
>>
>> <form name="frmBankDetail" method="post" action="WorkingArea_Bank.aspx"
>> id="frmBankDetail"> <div> [color=#FF0000][/[b]<input type="hidden"
>> name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKMTU5OTg4MzUzNWRk"
>> />[/b][color] </div> <table borderColor='#000000' cellSpacing='1'
>> cellPadding='3' width='100%' bgColor='#000000' border='0'> <tr
>> class="shade"> <td nowrap width='12%'><b>BankName</b></td> <td nowrap
>> width='12%'><b>BankAccount</b></td> <td nowrap
>> width='12%'><b>BankAccountNo</b></td> <td nowrap
>> width='12%'><b>Address</b></td> </tr> <tr bgColor="#e5e5e5" align=left>
>> <td><input name="TxtBankName" type="text" id="TxtBankName" /></td>
>> <td><input name="TxtBankAccount" type="text" id="TxtBankAccount" /></td>
>> <td><input name="TxtBankAccountNo" type="text" id="TxtBankAccountNo" /></td>
>> <td><input name="TxtBankAddress" type="text" id="TxtBankAddress" /></td>
>> </tr> <tr class="shade"><td align=left><input name="BtnSaveBank"
>> type="button" id="BtnSaveBank" class="button" value="Save"
>> onclick="fnInsertBank();" /><td colspan=3></td></tr> </table> </form>
>>
>>
>>
>> Now I have two solutions for it.
>>
>>
>>
>> The first is to chagne the Ajax page to HTML form and HTML controls.
>>
>>
>>
>> Another solutions is to move all the elements from Ajax page to main page.
>>
>>
>>
>> I don't know which is better, But at least i got the solution. Thanks all.:)
>>
>> "Benny Ng" <benny.ng(a)rattansoft.com> wrote in message
>> news:ecJ0skIlIHA.5080(a)TK2MSFTNGP02.phx.gbl...


>> Submitted via EggHeadCafe - Software Developer Portal of Choice
>> ASP.NET Caching Concepts
>> http://www.eggheadcafe.com/tutorials/aspnet/78de4d09-b013-48c0-8d4a-bedd68f675f5/aspnet-caching-concepts.aspx