I tried looping thru the datalist like this:
For Each i As DataListItem In Me.DataList1.It ems
Dim CartId As Label = CType(i.FindCon trol("Label1"), Label)
Dim Qty As TextBox = CType(i.FindCon trol("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.co m> wrote in message
news:uU******** ******@TK2MSFTN GP09.phx.gbl...
foreach (DataListItem item in myDataList.Item s)
{
myTextBox = item.FindContro l ("textboxId" );
}
Note, that the textbox in the item template should have runat="server".
Eliyahu
"VB Programmer" <do**@emailme.c om> wrote in message
news:uq******** ******@TK2MSFTN GP09.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?