前台:
<asp:DataList ID="DataList1" runat="server"
Xoncancelcommand="DataList1_CancelCommand"
Xondeletecommand="DataList1_DeleteCommand" Xoneditcommand="DataList1_EditCommand"
Xonitemcommand="DataList1_ItemCommand" Xonupdatecommand="DataList1_UpdateCommand">
<EditItemTemplate>
商品名称:<asp:TextBox ID="TextBox1" runat="server" Text='<%# Eval("name") %>'></asp:TextBox>
<br />
商品价格:<asp:TextBox ID="TextBox2" runat="server" Text='<%# Eval("price") %>'></asp:TextBox>
<br />
<asp:Button ID="Button3" runat="server" CommandArgument='<%# Eval("id") %>'
CommandName="update" Text="更新" />
<asp:Button ID="Button4" runat="server" CommandName="cancel" Text="取消" />
</EditItemTemplate>
<ItemTemplate>
商品id