Sanjay Chintha
Sanjay Chintha

Reputation: 326

Adding rows and removing rows to table using Jquery in asp.net

Here I have a table in Master Page

table border="1" border-style="dashed" width="80%" id="tblAddBirthdays" tr id="tr" td asp:TextBox ID="txFirstName" runat="server" asp:TextBox asp:TextBox ID ="txLastName" runat="server" asp:DropDownList ID="dlMonth" runat="server" asp:DropDownList ID="dlDate" runat="server" asp:DropDownList ID="dlYear" runat="server" asp:DropDownList ID="dlAgeRange" runat="server" asp:DropDownList ID="dlRelationship" runat="server" asp:DropDownList ID="dlGender" runat="server" And Link Buttons asp:LinkButton ID="lnkLess" runat="server" Text="(<<)Less "

OnClientClick="JavaScript: return false;" />   >)" OnClientClick="jQuery:add()" />

Now I want to add rows to table by clicking on link button using Jquery Dynamically Asp.net Master Page , i am trying from two days not getting it , can any body help me..

Upvotes: 0

Views: 1221

Answers (1)

Devesh
Devesh

Reputation: 4550

Adding from the client side in ASP.NET may not work as expected because it will not update the viewstate of the ASP.NET webform . It will be better that you use the UpdatePanel and add the row. In normal jquery ADD use some thing like this

             var tbl = $("#tableId");
             tbl.appendTo('<tr><td></td></tr>');

You have to use the normal html fields like

            <input type="text" id="txt" name="txt" />

Upvotes: 0

Related Questions