我在頁面中使用asp:中繼器,它有OnItemCommand。但在IE7(兼容模式),當我在轉發點擊按鈕,它不工作,說此錯誤:asp:轉發器項目命令不觸發在IE7(兼容模式)
Invalid postback or callback argument. Event validation is enabled using in configuration or 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.
這是代碼:
<asp:Repeater ID="rptExternalLinks" runat="server" OnItemCommand="rptExternalLinks_ItemCommand1">
<ItemTemplate>
<asp:Button ID="lbtnDelet" CssClass="simaUI-icon simaUI-icon-closethick" runat="server" CommandName="DeleteItem" />
</ItemTemplate>
</asp:Repeater>
它在其他瀏覽器像IE9,FF,Chrome和...但它說IE兼容模式的錯誤。
感謝塞巴斯蒂安,這是因爲回發,我在頁面加載測試頁面創建一個列表,然後設置中繼器的數據源到該列表,我把創建列表中的「」if(!Page.IsPostBack ){}「」,它的工作原理。 但鋼它沒有解決,爲什麼它在其他瀏覽器工作... – Emech 2012-03-14 16:35:05
這很奇怪,這是我必須找出。 – 2012-03-14 16:47:41