簡體   English   中英

Repeater中的LinkBut​​ton導致回發而按鈕不起作用

[英]LinkButton in Repeater causes postback and button doesn't

確定,所以我有一個更新面板圍繞我的控件。 我有2個下拉列表,它們具有從代碼隱藏運行的功能和項目的轉發器。 我已經在Repeater中使用按鈕進行了測試,該按鈕不進行回發,但是linkbutton可以進行回發。 我究竟做錯了什么?

也是在usercontrol no aspx頁面內。

<asp:UpdatePanel ID="upLocation" runat="server" UpdateMode="Conditional" RenderMode="Inline">
<ContentTemplate>
<asp:Repeater ID="rptMuniProducts" runat="server">
    <HeaderTemplate>
        <table class="table">
            <thead>
                <tr>
                    <th class="w80"></th>
                    <th>Product</th>
                    <th>Product Type</th>
                 </tr>
             </thead>
             <tbody>
    </HeaderTemplate>
    <ItemTemplate>
                  <tr>
                     <td class="actions">
                      <asp:Button ID="btnProd" runat="server" OnClick="btnProd_Click" Text="test" />
                      <asp:LinkButton ID="lnkDeleteProd" runat="server" OnClick="lnkDeleteProd_Click">Link Test</asp:LinkButton>
                       <asp:HiddenField ID="hdnId" runat="server" Value='<%# DataBinder.Eval(Container, "DataItem.Id") %>' />
                      </td>
                      <td><%# DataBinder.Eval(Container, "DataItem.Name") %></td>
                      <td><%# DataBinder.Eval(Container, "DataItem.Producttype") %></td>
                    </tr>
     </ItemTemplate>
     <FooterTemplate>
                </tbody>
            </table>
     </FooterTemplate>
</asp:Repeater>
</ContentTemplate>
</asp:UpdatePanel>

您是否嘗試過在LinkBut​​ton上設置ClientIDMode = Auto? 有一個長期存在的.NET錯誤,包含doPostBack和非自動客戶端ID。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM