我有一個網頁與各種控制。其中兩個是下拉列表。第一個下拉列表將從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