I have a GridView with a header and some rows and want to add another row just below the header using jQuery.
<form id="form1" runat="server">
<div>
<asp:GridView ID="GridView1" ShowHeader="true" runat="server">
<Columns>
<asp:TemplateField HeaderText="Activity Name">
<ItemTemplate>
<asp:Label runat="server" Text= <%# DataBinder.Eval(Container.DataItem, "Name") %> ></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:Button Text="Add Activity" runat="server" OnClientClick="addActivity(); return false;" />
</div>
</form>
我的努力是
$( #GridView1 tbody ).prepend( <tr><td>new activity</td></tr> );
头盔上的新行号
$( #GridView1 table tr:first ).after( <tr><td>new activity</td></tr> );
没有任何东西(至少看不到任何东西,也没有任何其他tr子)