我有一个网页与各种控制。其中两个是下拉列表。第一个下拉列表将从page_load事件的xml文件中填充。这工作正常。在第一个下拉列表中,附加了一个级联下拉列表扩展器,每当第一个下拉列表中的选择发生更改时,就会调用Web服务。这工作也很好。在我的两个dropdownlists下面,我有一个按钮,可以将页面返回。然而,当我在第二个下拉列表已经做出了选择,并点击按钮,我得到以下错误:回发或回调参数无效。当点击按钮
Server Error in '/' Application. Invalid postback or callback argument. Event validation is enabled using 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. 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.ArgumentException: Invalid postback or callback argument. Event validation is enabled using 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.
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:
[ArgumentException: Invalid postback or callback argument. Event validation is enabled using 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.] System.Web.UI.ClientScriptManager.ValidateEvent(String uniqueId, String argument) +10945696 System.Web.UI.WebControls.DropDownList.LoadPostData(String postDataKey, NameValueCollection postCollection) +72 System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) +507 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2071
对不起,可怕的格式。有关为何引发此错误以及如何防止它的任何建议?
感谢,
本
一个漂亮的解决方法,但仍然hacky国际海事组织。不要试图'破解'已经很烂的东西(即CDDL)。还是你的电话。 =) – RPM1984 2010-08-03 03:49:43
我看了看更新面板,但卡住了。我想将第二个下拉列表的文本更改为“正在加载...”,而后台逻辑正在获取这些值。我正在使用附加到第一个下拉列表的onchange javascript。但是,文本更改正常,但回发似乎中断,没有值加载。任何想法如何解决这个问题? – b3n 2010-08-03 05:20:13
我正在做同样的事情。我有一个下拉菜单:选择状态。当他们选择一个状态时,第二个下拉列表将文本设置为“加载城市...”,对Web服务进行ajax调用,并将其绑定到下拉列表。全部使用jQuery和Web服务调用。 (第一次ddl的onchange事件)。要在后台执行此操作,您需要异步调用Web服务,并提供回调函数 - 然后在回调函数中清除加载文本并绑定值。 – RPM1984 2010-08-03 05:57:55