前台代码:
<asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="false" HeaderText="Staff Detail"
DataKeyNames="staffId" OnItemUpdated="DetailsView1_ItemUpdated" OnModeChanging="DetailsView1_ModeChanging"
OnItemUpdating="DetailsView1_onItemUpdating" OnItemCommand="DetailsView1_onItemCommand">
<HeaderStyle BackColor="BlueViolet" ForeColor="Black" Height="20px" />
<Fields>
<asp:BoundField HeaderText="Staff ID" DataField="staffId" ReadOnly="true" />
<asp:BoundField HeaderText="User Name" DataField="userName" ReadOnly="true" />
<asp:BoundField HeaderText="First Name" DataField="firstName" ReadOnly="true" />
<asp:BoundField HeaderText="Last Name" DataField="LastName" ReadOnly="true" />
<asp:TemplateField HeaderText="Department">
<EditItemTemplate>
<asp:DropDownList ID="departmentlist" runat="server">
</asp:DropDownList>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Role">
<EditItemTemplate>
<asp:DropDownList ID="roledroplist" runat="server">
</asp:DropDownList>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Office">
<EditItemTemplate>
<asp:TextBox ID="office" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "roomName") %>'></asp:TextBox>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Phone Number">
<EditItemTemplate>
<asp:TextBox ID="phonenumber" runat="server" Text='<%#DataBinder.Eval(Container.DataItem,"phoneNumber")%>'></asp:TextBox>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Address">
<EditItemTemplate>
<asp:TextBox ID="address" runat="server" Text='<%#DataBinder.Eval(Container.DataItem,"address")%>'></asp:TextBox>
</EditItemTemplate>
</asp:TemplateField>
<asp:CommandField ShowEditButton="true" />
</Fields>
</asp:DetailsView>
在cs 代码中怎么写?是写在ItemUpdating中吗
protected void DetailsView1_onItemUpdating(object sender,DetailsViewUpdateEventArgs e)
{
}