I tried looping thru the datalist like this:
For Each i As DataListItem In Me.DataList1.Items
Dim CartId As Label = CType(i.FindControl("Label1"), Label)
Dim Qty As TextBox = CType(i.FindControl("txtQty"), TextBox)
Response.Write(CartId.Text & ":" & Qty.Text & "<br>")
Next
Qty gets filled properly. But, CartId ALWAYS comes up blank even though I
visually can see that there's a .text value. Any ideas why?
Thanks.
"Eliyahu Goldin" <re*************@monarchmed.com> wrote in message
news:uU**************@TK2MSFTNGP09.phx.gbl...
foreach (DataListItem item in myDataList.Items)
{
myTextBox = item.FindControl ("textboxId");
}
Note, that the textbox in the item template should have runat="server".
Eliyahu
"VB Programmer" <do**@emailme.com> wrote in message
news:uq**************@TK2MSFTNGP09.phx.gbl... I have a datalist for a shopping cart summary. Each data "row" has a
text
box where they can enter a quantity. How do I loop thru the entire
datalist to figure out the total shopping cart price?