刚开始部署到电脑上好的,第二天重启就报这个错.找了好久还是解决不了这个错误.网上说viewsatat 值被改了.然后page 禁用viewstate 结果不起作用.相反的页面用到 scriptManager 控件的页面是100% 会抱错, 把页面的 scriptManager 删除掉 页面会报错 但不是每次都报错.求解为何啊!Server Error in '/' Application.
--------------------------------------------------------------------------------Unable to validate data. 
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: Unable to validate data.Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  Stack Trace: 
[HttpException (0x80004005): Unable to validate data.]
   System.Web.Configuration.MachineKeySection.EncryptOrDecryptData(Boolean fEncrypt, Byte[] buf, Byte[] modifier, Int32 start, Int32 length, Boolean useValidationSymAlgo, Boolean useLegacyMode, IVType ivType, Boolean signData) +1083
   System.Web.UI.Page.EncryptStringWithIV(String s, IVType ivType) +119
   System.Web.Handlers.RuntimeScriptResourceHandler.GetScriptResourceUrlImpl(List`1 assemblyResourceLists, Boolean zip) +1620
   System.Web.Handlers.RuntimeScriptResourceHandler.System.Web.Handlers.IScriptResourceHandler.GetScriptResourceUrl(List`1 assemblyResourceLists, Boolean zip) +696
   System.Web.Handlers.RuntimeScriptResourceHandler.System.Web.Handlers.IScriptResourceHandler.GetScriptResourceUrl(Assembly assembly, String resourceName, CultureInfo culture, Boolean zip) +143
   System.Web.UI.ScriptReference.GetUrlFromName(ScriptManager scriptManager, IControl scriptManagerControl, Boolean zip) +301
   System.Web.UI.ScriptReference.GetUrlInternal(ScriptManager scriptManager, Boolean zip) +619
   System.Web.UI.ScriptReference.GetUrl(ScriptManager scriptManager, Boolean zip) +206
   System.Web.UI.ScriptManager.RegisterUniqueScripts(List`1 uniqueScripts) +211
   System.Web.UI.ScriptManager.RegisterScripts() +458
   System.Web.UI.ScriptManager.OnPagePreRenderComplete(Object sender, EventArgs e) +125
   System.Web.UI.Page.OnPreRenderComplete(EventArgs e) +113
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +8164 
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1 

解决方案 »

  1.   

    Version Information: Microsoft .NET Framework Version:4.0.30319版本是4.0,把它配置成2.0试试
      

  2.   

    错误解决.不敢独享.
    <system.web>
          <machineKey validationKey="3FF1E929BC0534950B0920A7B59FA698BD02DFE8" decryptionKey="280450BB36319B474C996B506A95AEDF9B51211B1D2B7A77" decryption="3DES" validation="SHA1"/>
          <compilation debug="true" targetFramework="4.0">
    在webconfig 里面加入machineKey 自定义的加密即可.
      

  3.   


    从来没用过  scriptManager  这玩意