2015-04-15 114 views
0

所以我有一臺計算機上此錯誤(不上2人):驗證表格後,未能提交

Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, [...] 

據happenning一個開發的計算機上,計算機,以便everithing運行時,斷言「如果這個應用程序是由Web場或羣集承載」是FALSE

按照MSDN博客我要刪除我的表單的action屬性(在ask_full_report.aspx

<form id="form1" runat="server" method="post" action="full_report.aspx"> 

但我不想刪除動作屬性,我想將我的表單提交到full_report.aspx

這裏是我的web.config(我刪除的appSettings下的某些鍵)

<configuration> 
    <appSettings> 
    <add key="URL_BASE" value=""/> 
    </appSettings> 
    <system.web> 
    <compilation debug="true" targetFramework="4.5" /> 
    <httpRuntime targetFramework="4.5" /> 
    </system.web> 
    <runtime> 
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> 
     <dependentAssembly> 
     <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" /> 
     <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" /> 
     </dependentAssembly> 
    </assemblyBinding> 
    </runtime> 
</configuration> 

對於this Answer:我不使用ViewStateUserKey

你有什麼事請的任何想法?

注意:我不認爲這是

額外的ressource重複:MSDN - HttpException Due to Invalid Viewstate After Installing .NET Framework 3.5 SP1


Ë DIT:今天,沒有采取任何行動,我再也沒有這個錯誤了。我已經打開這篇文章,因爲這個錯誤沒有很好的記錄。如果有人有解決方案,請發表一個答案。

回答

1

我剛剛遇到了同樣的問題和解決方法是把下面的代碼在web.config中<system.web>像下面

<system.web> 
<machineKey validationKey="627BF72BB33AA8D28CA2C3E80920BA4DF0B726F97EEFBB0F4818350D63E6AFA380811F13ED1F086E386284654DB3" 
decryptionKey="F40B6E5A02B29A181D2D213B5ED8F50B73CFCFD0CC56E137" validation="SHA1" /> 
    </system.web> 

this如果你想

+0

生成自己的密鑰任何想法爲什麼其他電腦不需要它? – Apolo

+0

今天,沒有采取任何行動,我再也沒有這個錯誤了。 (......) – Apolo