如果我在客戶端項目添加到選擇元素,然後提交表單,我得到以下錯誤: -如何在服務器端註冊客戶端添加的數據以進行回發驗證?
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.
我不想禁用EventValidation。我如何將在客戶端添加的數據註冊到特定的元素以在服務器端進行回發驗證?
我知道RegisterForEventValidation
方法在那裏,但我從來沒有使用它,甚至我不明白從msdn。
如果有人曾經這樣做過,請簡單介紹一下示例代碼嗎?
+1爲您回覆。但是我發現我的問題的答案是它不是完全可能的,但是如果我知道將要在客戶端預先添加的值,那麼我可以將這些值註冊爲該控件的有效後數據,使用* * Page.ClientScript.RegisterForEventValidation **。謝謝! – teenup