0
爲什麼作爲鏈接按鈕事件或項目命令的我的事件沒有被觸發,直到我用頁面中的另一個控件回發頁面。 例如,在此代碼:中繼器中的事件沒有被觸發,直到頁面通過asp.net c#中的其他控件回發。
<div id="pagination">
<span class="all" runat="server" id="CurrentPage">Total Pages</span>
<asp:Repeater ID="RPTPaging" runat="server" Visible="false" OnItemDataBound="RPTPaging_ItemDataBound" OnItemCommand="RPTPaging_ItemCommand">
<ItemTemplate>
<asp:LinkButton ID="BtnPage" CssClass="inactive" CommandName="Page" CommandArgument="<%# Container.DataItem %>" runat="server" Text="<%# Container.DataItem %>"></asp:LinkButton>
</ItemTemplate>
</asp:Repeater>
</div>
與此相關的問題 Why Repeater ItemCommand Doesn't fire, even if i don't rebind by post back?
我發現,當我在這個中繼什麼都沒有發生的鏈接點擊鏈接,但經過我點擊空的輸入按鈕頁面上,後發回一個頁面改變corectlly。