尝试屏蔽废弃已建立的网站时,获取无效的回发或回调参数错误ASP.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.
"""
你基本上在正确的轨道上。我做了一些改动。在
错误消息真的很有用。如果你读了它的msdn page,就会有一个提示。在
总结如下:不要发布不符合
GET
格式的参数或值在您的例子中,意味着如果您选择一个状态,它应该是
cboState
select元素中的一个值。(例如2不是有效值)但这在您的示例中是正确的,所以第二点是不要在post请求中包含无效的参数。这意味着在本例中,当您发布到
__EVENTTARGET
cboState时,不应该添加cboCity
。在长话短说您需要使用以下表单域:
脚本的更新版本:https://gist.github.com/fliiiix/ea365b96f5ab4ec4d345
相关问题 更多 >
编程相关推荐