【发布时间】:2014-03-12 06:33:22
【问题描述】:
我的项目中有一个数据列表,它有两列(“价格”和“数量”)
价格来自数据库。 我正在使用 DropdownList 作为数量。
我想将这两列相乘并动态获得结果。这里的重点是,如果我更改数量,结果必须在不刷新页面的情况下更改。
我该怎么做? 这样做的 datalist 事件是什么?
谢谢。
我的代码
<asp:DataList ID="DataList1" DataKeyField="SIRANO" runat="server"
onitemcommand="DataList1_ItemCommand" >
Price:<asp:Label ID="Label5" runat="server" Text='<%#Eval("PRICE") %>'></asp:Label>
Quantity:<asp:DropDownList ID="DropDownList1" runat="server" Height="20px" Width="48px">
<asp:ListItem>3</asp:ListItem>
</asp:DropDownList>
<b> Total:<asp:Label ID="Label7" runat="server"></asp:Label></b>
【问题讨论】: