How get value textbox in datalist row?

Discussion in 'ASP .Net' started by VB Programmer, Nov 16, 2005.

  1. In my ASPX page how do I get the .text value of a textbox that is in the
    ItemTemplate of a datalist (using HTML)?

    The textbox contains the quantity for a shopping cart item.

    The textbox is called "txtQty" and the current HTML is this (I need to
    replace xxxx with the text value from the textbox):

    <A href='UpdateCart.aspx?CartId=<%# DataBinder.Eval(Container.DataItem,
    "CartID") %>&Qty=xxxx'><IMG src="Resources/UpdateBtn.jpg" border="0"></A>

    Thanks.
    VB Programmer, Nov 16, 2005
    #1
    1. Advertising

  2. have you tried Qty.Text
    Patrick


    "VB Programmer" <> wrote in message
    news:...
    > In my ASPX page how do I get the .text value of a textbox that is in the
    > ItemTemplate of a datalist (using HTML)?
    >
    > The textbox contains the quantity for a shopping cart item.
    >
    > The textbox is called "txtQty" and the current HTML is this (I need to
    > replace xxxx with the text value from the textbox):
    >
    > <A href='UpdateCart.aspx?CartId=<%# DataBinder.Eval(Container.DataItem,
    > "CartID") %>&Qty=xxxx'><IMG src="Resources/UpdateBtn.jpg" border="0"></A>
    >
    > Thanks.
    >
    >
    Patrick.O.Ige, Nov 16, 2005
    #2
    1. Advertising

  3. Or
    'UpdateCart.aspx?='<%#"Shop.aspx?CategoryId=" &
    DataBinder.Eval(Container.DataItem, "Qty")%>'>
    Patrick


    "VB Programmer" <> wrote in message
    news:...
    > In my ASPX page how do I get the .text value of a textbox that is in the
    > ItemTemplate of a datalist (using HTML)?
    >
    > The textbox contains the quantity for a shopping cart item.
    >
    > The textbox is called "txtQty" and the current HTML is this (I need to
    > replace xxxx with the text value from the textbox):
    >
    > <A href='UpdateCart.aspx?CartId=<%# DataBinder.Eval(Container.DataItem,
    > "CartID") %>&Qty=xxxx'><IMG src="Resources/UpdateBtn.jpg" border="0"></A>
    >
    > Thanks.
    >
    >
    Patrick.O.Ige, Nov 16, 2005
    #3
  4. I get this error:

    DataBinder.Eval: 'System.Data.DataRowView' does not contain a property with
    the name txtQty.

    txtQty is a textbox that the user puts the quantity in. It's a simple
    shopping cart. User puts in a qty then clicks update.

    "Patrick.O.Ige" <> wrote in message
    news:%...
    > Or
    > 'UpdateCart.aspx?='<%#"Shop.aspx?CategoryId=" &
    > DataBinder.Eval(Container.DataItem, "Qty")%>'>
    > Patrick
    >
    >
    > "VB Programmer" <> wrote in message
    > news:...
    >> In my ASPX page how do I get the .text value of a textbox that is in the
    >> ItemTemplate of a datalist (using HTML)?
    >>
    >> The textbox contains the quantity for a shopping cart item.
    >>
    >> The textbox is called "txtQty" and the current HTML is this (I need to
    >> replace xxxx with the text value from the textbox):
    >>
    >> <A href='UpdateCart.aspx?CartId=<%# DataBinder.Eval(Container.DataItem,
    >> "CartID") %>&Qty=xxxx'><IMG src="Resources/UpdateBtn.jpg" border="0"></A>
    >>
    >> Thanks.
    >>
    >>

    >
    >
    VB Programmer, Nov 16, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Peter Afonin

    How to get value from a textbox in DataList

    Peter Afonin, Apr 7, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    1,578
    Peter Afonin
    Apr 7, 2004
  2. Nevyn Twyll
    Replies:
    8
    Views:
    1,849
  3. H5N1
    Replies:
    0
    Views:
    2,700
  4. D
    Replies:
    0
    Views:
    198
  5. Peter Afonin

    How to get value from a textbox in DataList

    Peter Afonin, Apr 7, 2004, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    146
    Peter Afonin
    Apr 7, 2004
Loading...

Share This Page