Updating txtQuantity Textbox in a Repeater

bizjosh

Member
Joined
Mar 16, 2005
Messages
23
Programming Experience
Beginner
I created a repeater to display my data inside a dataTable of Session("Cart")
however i have a problem. I do not know how to to update the Quantity
displayed in a txtQuantity. How do i code a 'btnUpdate' so that it will read
the txtQuantity and update each row of item's quantity according to the
txtQuantity.Text. The code should update to the datatable and display
on updated value on the txtQuantity after button has been clicked, this
is my code for the display of shopping cart items in a repeater.

<asp:Repeater id="viewCart" runat="server">
<ItemTemplate>
<tr>
<td height="15"><%# Container.DataItem("Product") %></td>
td><%# Container.DataItem("Code") %></td>
<td><%# Double.Parse(Container.DataItem("Cost")).ToString("C") %></td>
<td align="center"><asp:TextBox ID="txtQuantity" Text='<%# Container.DataItem("Quantity") %>' ToolTip="Quantity" Width="20" MaxLength="2" runat="server" /></td>
<td>Remove</td>
</tr>
</ItemTemplate>
</asp:Repeater>

Header Codes:

Dim dtCart As DataTable
Dim drCart As DataRow
dtCart = Session("Cart")
viewCart.DataSource = dtCart.DefaultView
viewCart.DataBind()
 
Back
Top