Re: How loop datalist to retrieve textbox value?
- From: "VB Programmer" <dont@xxxxxxxxxxx>
- Date: Wed, 16 Nov 2005 08:00:00 -0500
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" <removemeegoldin@xxxxxxxxxxxxxx> wrote in message
news:uUyt28O6FHA.3136@xxxxxxxxxxxxxxxxxxxxxxx
> 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" <dont@xxxxxxxxxxx> wrote in message
> news:uqg9RTL6FHA.1416@xxxxxxxxxxxxxxxxxxxxxxx
>> 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?
>>
>>
>
>
.
- References:
- How loop datalist to retrieve textbox value?
- From: VB Programmer
- Re: How loop datalist to retrieve textbox value?
- From: Eliyahu Goldin
- How loop datalist to retrieve textbox value?
- Prev by Date: Re: How get value textbox in datalist row?
- Next by Date: Re: Abstract Base Page in .Net 2.0
- Previous by thread: Re: How loop datalist to retrieve textbox value?
- Next by thread: RE: Trouble deploying ASP.NET application
- Index(es):