none
Sys.WebForms.PageRequestManagerServerErrorException: Validation of viewstate MAC failed. RRS feed

  • 问题


  • 母版页

    <asp:ToolkitScriptManager ID="ToolkitScriptManager" runat="server" CombineScripts="false" EnablePartialRendering="false">
        </asp:ToolkitScriptManager>

    内容页

    <%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage/MainSite.Master"
        AutoEventWireup="true" CodeBehind="Register.aspx.cs" Inherits="account.Register"
        Debug="true" ViewStateEncryptionMode="Never" EnableEventValidation="false" ValidateRequest="false" %>

    用了dropdownlist

    <asp:DropDownList ID="dropCountry" runat="server">
                        </asp:DropDownList>
                        <asp:CascadingDropDown ID="CascadingDropDown1" TargetControlID="dropCountry" LoadingText="加载中..."
                            PromptText="国家" ServiceMethod="GetCountry" ServicePath="~/WebService.asmx"
                            Category="o_id" runat="server">
                        </asp:CascadingDropDown>
                        <asp:DropDownList ID="dropProvince" runat="server">
                        </asp:DropDownList>
                        <asp:CascadingDropDown ID="CascadingDropDown2" TargetControlID="dropProvince" LoadingText="加载中..."
                            PromptText="省(州)" ServiceMethod="GetProvince" ServicePath="~/WebService.asmx"
                            Category="p_id" ParentControlID="dropCountry" runat="server">
                        </asp:CascadingDropDown>
                        <asp:DropDownList ID="dropLocation" runat="server">
                        </asp:DropDownList>
                        <asp:CascadingDropDown ID="CascadingDropDown3" TargetControlID="dropCity" LoadingText="加载中..."
                            PromptText="城市" ServiceMethod="GetCity" ServicePath="~/WebService.asmx"
                            Category="c_id" runat="server" ParentControlID="dropProvince">
                        </asp:CascadingDropDown>

     <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Always">
                            <ContentTemplate>
                                <asp:Button ID="btnRegister" runat="server" CssClass="basic-btn" Text="注册" OnClick="btnRegister_Click" />
                            </ContentTemplate>
                        </asp:UpdatePanel>

    点击注册按钮就报如下错误~

    Sys.WebForms.PageRequestManagerServerErrorException: 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.

    求解决。。。。。。。。。。。。。。。。。。。。

    2012年3月12日 2:52

答案