如何使用Jquery在gridview中添加linkbutton

时间:2015-04-03 14:10:36

标签: c# jquery asp.net gridview

我正在使用Jquery在gridview中使用搜索功能,如本文所述:http://www.aspsnippets.com/Articles/Search-GridView-with-Paging-on-TextBox-KeyPress-using-jQuery-in-ASPNet.aspx

搜索功能工作正常,但问题是当我在网格视图中添加链接按钮时:

  <asp:GridView ID="gvCustomers" runat="server" AutoGenerateColumns="false" onrowcommand="gvCustomers_RowCommand" >
<Columns>
          <asp:TemplateField HeaderText="legername" HeaderStyle-Width="150px">
        <ItemTemplate>
            <asp:Label ID="leger_name" Text='<%# Eval("leger_name") %>' runat="server" />
        </ItemTemplate>
    </asp:TemplateField>

      <asp:TemplateField HeaderText="ledgerCode" HeaderStyle-Width="150px">
        <ItemTemplate>
            <asp:Label ID="lblCustomerId" Text='<%# Eval("ledgerCode") %>' runat="server" />
        </ItemTemplate>
    </asp:TemplateField>

    <asp:TemplateField  HeaderText="control" HeaderStyle-Width="150px">
        <ItemTemplate>
            <asp:Label ID="lblCity" Text='<%# Eval("control") %>' runat="server" />
        </ItemTemplate>
    </asp:TemplateField>

         <asp:TemplateField  HeaderText="delete"  HeaderStyle-Width="150px"> 
                                <ItemTemplate>
                                    <asp:LinkButton  runat="server" ID="LinkButton1"  CommandName="DeleteRecored" CommandArgument='<%# DataBinder.Eval(Container, "RowIndex") %>' >delete</asp:LinkButton>
                                </ItemTemplate>
                                </asp:TemplateField>
</Columns>

gridview会出现问题但效果不佳

0 个答案:

没有答案