前台代码:
<ASP:Label id="Message" runat="server"></ASP:Label><BR>
<ASP:datagrid id="BigClassList" Width="100%" CellPadding="3" Runat="server" DataKeyField="BigClassID" OnUpdateCommand="MyDataGrid_Update" OnCancelCommand="MyDataGrid_Cancel" OnEditCommand="MyDataGrid_Edit" OnDeleteCommand="MyDataGrid_Del" OnSortCommand="MyDataGrid_Sort" OnItemCreated="MyDataGrid_ItemCreated" AutoGenerateColumns="False" AllowSorting="True">
<HeaderStyle Font-Bold="True" BackColor="Gainsboro"></HeaderStyle>
<Columns>
<ASP:BoundColumn DataField="BigClassID" ReadOnly="True" HeaderText="大类编号" SortExpression="BigClassID"></ASP:BoundColumn>
<ASP:BoundColumn DataField="BigClassName" HeaderText="大类名称" SortExpression="BigClassName"></ASP:BoundColumn>
<ASP:BoundColumn DataField="BigClassSortID" HeaderText="排序编号" SortExpression="BigClassSortID"></ASP:BoundColumn>
<ASP:EditCommandColumn ButtonType="LinkButton" UpdateText="更新" CancelText="返回" EditText="编辑"></ASP:EditCommandColumn>
<ASP:TemplateColumn>
<ItemTemplate>
<ASP:LinkButton id="cmdDel" runat="server" Text="删除" CommandName="Delete"></ASP:LinkButton>
</ItemTemplate>
</ASP:TemplateColumn>
</Columns>
</ASP:datagrid>
<table height="23" cellSpacing="0" cellPadding="3" width="100%" boder="0">
<tr>
<td bgColor="#efefef">添加新大类</td>