关于datalist 中的一些编辑和更新

来源:互联网 发布:ods层和数据集市的区别 编辑:程序博客网 时间:2024/05/01 15:28
<asp:DataList runat="server" ID="Class_dataList" Width="133px" ondeletecommand="Class_dataList_DeleteCommand" oneditcommand="Class_dataList_EditCommand" onupdatecommand="Class_dataList_UpdateCommand" onCancelCommand="Class_dataList_CancelCommand" > <HeaderTemplate> 文章分类名 </HeaderTemplate> <ItemTemplate> <table> <tr> <td class="style1"> <%#Eval("st_c_name") %> </td> <td> <asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="编辑" /> </td> </tr> </table> </ItemTemplate> <EditItemTemplate> <asp:TextBox ID="classname" Text='<%#Eval("st_c_name") %>' runat="server"> </asp:TextBox> <asp:TextBox runat="server" ID="classid" Text='<%#Eval("st_c_id") %>' Visible="false"> </asp:TextBox> <asp:Button runat="server" ID="UpdateButton" CommandName="Update" Text="修改"/> <asp:Button runat="server" ID="DeleteButton" CommandName="Delete" Text="删除" /> <asp:Button runat="server" ID="CancelButton" CommandName="Cancel" Text="取消" /> </EditItemTemplate> </asp:DataList>