C# 网站总是出现以下错误无法加载viewstate

C# 网站总是出现以下错误无法加载viewstate,c#,asp.net,C#,Asp.net,最近,我不知道为什么我们的网站总是出现以下错误,但之前我从未收到过同样的错误。 请求IP是91.201.66.76,我不知道我的主机是否遇到攻击 错误消息:无法加载viewstate。正在加载viewstate的控件树必须与上次请求期间用于保存viewstate的控件树匹配。例如,动态添加控件时,回发期间添加的控件必须与初始请求期间添加的控件的类型和位置匹配 Request URL: http://www.hicalc.com/SignUp.aspx Request IP: 91.201.66

最近,我不知道为什么我们的网站总是出现以下错误,但之前我从未收到过同样的错误。 请求IP是
91.201.66.76
,我不知道我的主机是否遇到攻击

错误消息:无法加载viewstate。正在加载viewstate的控件树必须与上次请求期间用于保存viewstate的控件树匹配。例如,动态添加控件时,回发期间添加的控件必须与初始请求期间添加的控件的类型和位置匹配

Request URL: http://www.hicalc.com/SignUp.aspx

Request IP: 91.201.66.76    Language:     Logined User: Anonymous

Beijing Time: 3/17/2011 2:57:41 PM ( UTC+8 )     Web Server Local Time: 3/17/2011 12:57:41 AM

HttpUnhandledException: "Exception of type 'System.Web.HttpUnhandledException' was thrown."
   at System.Web.UI.Page.HandleError(Exception e)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest()
   at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
   at System.Web.UI.Page.ProcessRequest(HttpContext context)
   at ASP.signup_aspx.ProcessRequest(HttpContext context)
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

HttpException: "Failed to load viewstate.  The control tree into which viewstate is being loaded must match the control tree that was used to save viewstate during the previous request.  For example, when adding controls dynamically, the controls added during a post-back must match the type and position of the controls added during the initial request."
   at System.Web.UI.Control.LoadViewStateRecursive(Object savedState)
   at System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState)
   at System.Web.UI.Control.LoadViewStateRecursive(Object savedState)
   at System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState)
   at System.Web.UI.Control.LoadViewStateRecursive(Object savedState)
   at System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState)
   at System.Web.UI.Control.LoadViewStateRecursive(Object savedState)
   at System.Web.UI.Page.LoadAllState()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

你的帖子里没有问题。我假设您问“为什么会发生此错误?”答案是,为了加载ViewState,控件树应该在回发之前与控件树完全匹配。和你的不匹配


如果您能提供更多关于您在页面上生成控件树所使用的代码类型的信息,我们可以更精确地指出生成的树不匹配的原因。

好的格式是您的朋友。谢谢
我的问题是为什么总是出现错误,请求IP总是91.201.66.76,我不知道我的网站是否受到攻击。是的,向网站提交伪造数据可能会导致此错误。这可能是来自此ip地址的攻击。谢谢!但我怎么知道这是伪造的数据呢?顺便说一句,如何使用最小标记格式生成换行符

和不工作捕获提交的内容并查看内部。你应该能够看到你的网站所接受的编程数据与虚假数据之间的差异。