我在Listview的 OnItemDataBound中给TextBox赋值了,当我单击了确认按钮的时候如何在OnItemCommand事件中取到TextBox值
<asp:ListView ID="lvMedics" runat="server" OnItemCommand="lvMedics_ItemCommand" OnItemDataBound="lvMedics_ItemDataBound"> <LayoutTemplate> <asp:PlaceHolder ID="groupPlaceHolder" runat="server"></asp:PlaceHolder> </LayoutTemplate> <GroupTemplate> <asp:PlaceHolder ID="itemPlaceHolder" runat="server"></asp:PlaceHolder> </GroupTemplate> <ItemTemplate> <tr> <td> <%# Eval("MedicineName")%> </td> <td> <asp:TextBox ID="txtBuyNum" runat="server" Width="60px"></asp:TextBox><span style="color: Red; font-size: 12px;">(/件)</span> </td> <td> <asp:Button runat="server" ID="btnBuy" Text="确认" CommandName="BuyFilter" CommandArgument='<%# Eval("Id") %>' /> </td> </tr> </ItemTemplate> </asp:ListView>
添加回答
举报
0/150
提交
取消