PDA

View Full Version : Validation of viewstate MAC failed



ehsan957
جمعه 10 فروردین 1386, 22:38 عصر
با سلام
من در صفحه ای با این نام story.aspx?sid=1 (شماره sid تعیین کننده مقادیر موجود در صفحه story.aspx می باشد) یک loginView دارم که در آن در صورت login بودن کاربر یک لینک را به او نشان می دهد . من وقتی Login می کنم و به این صفحه می آیم اگر Logout کنم با خطای زیر مواجه می شوم علت چیه؟

Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.

nazaninam
جمعه 10 فروردین 1386, 22:44 عصر
کد ها ی زیر رو داخل فایل وب کانفیگ قرار بدید



<machineKey validationKey='A96B2F3BF50A1A2A1B81214A550B89F2A31 8B3712FB5AC8CD82AF4F3925B3C6ED58CF5F38503629A78BF8 C27B1B736C4E84DACE342AB83A42932B44EBC3D7601'
decryptionKey='D01201C69DF5E9863133028CBD4E6EEFC45 B5E609D7F4107'
validation="SHA1"/>
<pages enableViewStateMac="false">

</pages>

ehsan957
جمعه 10 فروردین 1386, 23:22 عصر
راه حل شما جواب نداد

خطای جدید به شکل زیر است
The state information is invalid for this page and might be corrupted.

__H2__
شنبه 11 فروردین 1386, 13:17 عصر
سلام
لطفاَ قسمتی از کدهای برنامه را قرار دهید.
شاید با دستور Try مشکلتان حل شود.

nazaninam
شنبه 11 فروردین 1386, 13:23 عصر
فایل وبکانفیگتو بگذار ببینیمش

ehsan957
یک شنبه 12 فروردین 1386, 00:08 صبح
این هم از فایل web.config :ناراحت:

nazaninam
یک شنبه 12 فروردین 1386, 12:30 عصر
من که چیزی نمی بینم !

ehsan957
یک شنبه 12 فروردین 1386, 15:25 عصر
<?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<appSettings>
<add key="admin" value="admin" />
</appSettings>
<connectionStrings/>
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.

Visual Basic options:
Set strict="true" to disallow all data type conversions
where data loss can occur.
Set explicit="true" to force declaration of all variables.
-->
<httpHandlers>
<add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
validate="false" />
</httpHandlers>
<authorization>
<allow roles="administrator" />
</authorization>
<roleManager enabled="true" />
<authentication mode="Forms" />
<compilation debug="true" strict="false" explicit="true">
<buildProviders>
<add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.Common, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</buildProviders>
</compilation>
<machineKey validationKey='A96B2F3BF50A1A2A1B81214A550B89F2A31 8B3712FB5AC8CD82AF4F3925B3C6ED58CF5F38503629A78BF8 C27B1B736C4E84DACE342AB83A42932B44EBC3D7601' decryptionKey='D01201C69DF5E9863133028CBD4E6EEFC45 B5E609D7F4107' validation="SHA1"/>
<pages enableViewStateMac="false">
<namespaces>
<clear/>
<add namespace="System"/>
<add namespace="System.Collections"/>
<add namespace="System.Collections.Specialized"/>
<add namespace="System.Configuration"/>
<add namespace="System.Text"/>
<add namespace="System.Text.RegularExpressions"/>
<add namespace="System.Web"/>
<add namespace="System.Web.Caching"/>
<add namespace="System.Web.SessionState"/>
<add namespace="System.Web.Security"/>
<add namespace="System.Web.Profile"/>
<add namespace="System.Web.UI"/>
<add namespace="System.Web.UI.WebControls"/>
<add namespace="System.Web.UI.WebControls.WebParts"/>
<add namespace="System.Web.UI.HtmlControls"/>
</namespaces>
</pages>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.

<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
</system.web>
</configuration>

ehsan957
چهارشنبه 15 فروردین 1386, 14:23 عصر
وقتی از صفحات معمولی Logout می کنم مشکلی ندارم ولی موقعی که از صفحه ای که دارای QueryString هست و من از این QueryString ها برای خواندن یک رکورد از دیتابیس استفاده می کنم Logout می کنم با این خطای Mac Faild مواجه میشم
راه حلش چیه؟
:متفکر::عصبانی++: