V
VB Programmer
With HTML, how do I get the value of a textbox in an ItemTemplate column
within a datagrid?
Simple shopping cart. For each row: 1 column is a textbox where they can
enter the quantity. 1 column is an update button that calls UpdateCart.aspx
passing it the CartId and Qty.
Here's the HTML....
<asp:TemplateColumn>
:
<ItemTemplate>
<asp:TextBox id=txtQty runat="server" Width="28px" Text='<%#
DataBinder.Eval(Container.DataItem, "ProductQty") %>'>
</asp:TextBox>
</ItemTemplate>
:
<ItemTemplate>
<A href='UpdateCart.aspx?CartId=<%#
DataBinder.Eval(Container.DataItem, "CartID") %>&Qty=<%# txtQty.text
%>'>
<asp:Image id="Image3" runat="server"
ImageUrl="Resources/UpdateBtn.jpg"></asp:Image></A>
</ItemTemplate>
</asp:TemplateColumn>
It doesn't like txtQty.text. I also tried entering
DataBinder.Eval(Container.DataItem, "ProductQty") but, of course, it selects
the ORIGINAL value...
Sorry. I'm just confused.
Thanks!
within a datagrid?
Simple shopping cart. For each row: 1 column is a textbox where they can
enter the quantity. 1 column is an update button that calls UpdateCart.aspx
passing it the CartId and Qty.
Here's the HTML....
<asp:TemplateColumn>
:
<ItemTemplate>
<asp:TextBox id=txtQty runat="server" Width="28px" Text='<%#
DataBinder.Eval(Container.DataItem, "ProductQty") %>'>
</asp:TextBox>
</ItemTemplate>
:
<ItemTemplate>
<A href='UpdateCart.aspx?CartId=<%#
DataBinder.Eval(Container.DataItem, "CartID") %>&Qty=<%# txtQty.text
%>'>
<asp:Image id="Image3" runat="server"
ImageUrl="Resources/UpdateBtn.jpg"></asp:Image></A>
</ItemTemplate>
</asp:TemplateColumn>
It doesn't like txtQty.text. I also tried entering
DataBinder.Eval(Container.DataItem, "ProductQty") but, of course, it selects
the ORIGINAL value...
Sorry. I'm just confused.
Thanks!