1
我收到了我的应用程序这个错误,当我尝试模拟有人用我的形式篡改宽处理异常部位...我怎样才能在vb.net
Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.
我明白为什么会发生什么它可以保护我,并且我希望它保持原位。 我想要做的是更好地处理它。显示一条更好的信息,说您的输入或类似信息有问题,而不是这个.net崩溃。
有没有办法我能赶上这个异常,并处理它在我的web.config文件中以类似的方式状态错误?
e.g
<customErrors mode="Off" defaultRedirect="Errors/GenericErrorPage.aspx">
<error statusCode="403" redirect="Errors/NoAccess.htm" />
<error statusCode="404" redirect="Errors/FileNotFound.htm" />
</customErrors>
恕我直言,你应该处理它尽可能靠近源地,但总是有选项[处理未捕获的异常(http://www.asp.net/web-api/overview/error-handling/web- API-全局错误处理) - 只是谷歌它 - 有相当多的地方,你可以连接多达那些 – Carsten
感谢您的评论和链接。我们有很多的旧形式上有没有真正有足够的异常处理长期运行webfroms项目......这将是很好处理集体对于此问题! – dstewart101
给予攻击者详细的错误信息是非常接近的事情不要做列表的顶部。 –