<asp:DetailsView ID="dvedit" runat="server" AutoGenerateRows="False"
EnableModelValidation="True" Height="50px" Width="932px"
onitemupdating="dvedit_ItemUpdating"
onmodechanging="dvedit_ModeChanging" DataKeyNames="Asset_ID"
CssClass="mGrid" ondatabound="dvedit_DataBound" >
<Fields>
<asp:CommandField ShowEditButton="True" CancelText="Cancel" EditText="Edit"
UpdateText="Update" ValidationGroup="modify"/>
<asp:BoundField DataField="Asset_ID" HeaderText="Asset ID" >
<HeaderStyle HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="Left" />
<asp:BoundField DataField="Retention_Period" HeaderText="Retention Period"
HeaderStyle-HorizontalAlign="Left">
<HeaderStyle HorizontalAlign="Left"></HeaderStyle>
<ItemStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:BoundField DataField="Backup_Type" HeaderText="Backup Type"
HeaderStyle-HorizontalAlign="Left">
<HeaderStyle HorizontalAlign="Left"></HeaderStyle>
<ItemStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:BoundField DataField="Backup_Location" HeaderText="Backup Location"
HeaderStyle-HorizontalAlign="Left">
<HeaderStyle HorizontalAlign="Left"></HeaderStyle>
<ItemStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:BoundField DataField="Backup_Software_Installed"
HeaderText="Backup Software Installed" HeaderStyle-HorizontalAlign="Left">
<HeaderStyle HorizontalAlign="Left"></HeaderStyle>
<ItemStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:BoundField DataField="Asset_Value" HeaderText="Asset Value"
HeaderStyle-HorizontalAlign="Left">
<HeaderStyle HorizontalAlign="Left"></HeaderStyle>
<ItemStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:BoundField DataField="Chassis_Name" HeaderText="Chassis Name" >
<HeaderStyle HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:BoundField DataField="USB_Reliance" HeaderText="USB Reliance" >
<HeaderStyle HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:TemplateField HeaderText="Purchase/Warranty/Lease Start Date(mm/dd/yyyy)">
<EditItemTemplate>
<asp:TextBox ID="txtlsdate" runat="server"
Text='<%# Bind("Start_Date","{0:MM/dd/yyyy}") %>'></asp:TextBox>
<asp:RegularExpressionValidator ID="rfvlsdate" runat="server"
ErrorMessage="Lease Start Date should be in MM/dd/yyyy format"
ControlToValidate="txtlsdate" ValidationGroup="modify"
ValidationExpression="^([0]\d|[1][0-2])\/([0-2]\d|[3][0-1])\/([2][01]|[1][6-9])\d{2}(\s([0-1]\d|[2][0-3])(\:[0-5]\d){1,2})?$">*</asp:RegularExpressionValidator>
</EditItemTemplate>
<InsertItemTemplate>
<asp:TextBox ID="TextBox8" runat="server"
Text='<%# Bind("Start_Date","{0:MM/dd/yyyy}") %>'></asp:TextBox>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="Label8" runat="server" Text='<%# Bind("Start_Date","{0:MM/dd/yyyy}") %>'></asp:Label>
</ItemTemplate>
<HeaderStyle HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Warranty/Lease End Date(mm/dd/yyyy)">
<EditItemTemplate>
<asp:TextBox ID="txtledate" runat="server" Text='<%# Bind("End_Date","{0:MM/dd/yyyy}") %>'></asp:TextBox>
<asp:RegularExpressionValidator ID="rfvledate" runat="server"
ErrorMessage="Lease End Date should be in MM/dd/yyyy format"
ControlToValidate="txtledate" ValidationGroup="modify"
ValidationExpression="^([0]\d|[1][0-2])\/([0-2]\d|[3][0-1])\/([2][01]|[1][6-9])\d{2}(\s([0-1]\d|[2][0-3])(\:[0-5]\d){1,2})?$">*</asp:RegularExpressionValidator>
</EditItemTemplate>
<InsertItemTemplate>
<asp:TextBox ID="TextBox9" runat="server" Text='<%# Bind("End_Date","{0:MM/dd/yyyy}") %>'></asp:TextBox>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="Label9" runat="server" Text='<%# Bind("End_Date","{0:MM/dd/yyyy}") %>'></asp:Label>
</ItemTemplate>
<HeaderStyle HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:BoundField DataField="SLA_On_Hardware_Fail"
HeaderText="SLA On H/W Failure" >
<HeaderStyle HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:BoundField DataField="Contact_Details_Of_Vendors"
HeaderText="Contact Details Of Vendors" >
<HeaderStyle HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:BoundField DataField="Asset_Owner_Name" HeaderText="Asset Owner Name"
HeaderStyle-HorizontalAlign="Left">
<HeaderStyle HorizontalAlign="Left"></HeaderStyle>
<ItemStyle HorizontalAlign="Left" />
<HeaderStyle HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:TemplateField HeaderText="Asset Owner EmailID">
<EditItemTemplate>
<asp:TextBox ID="txtamail" runat="server"
Text='<%# Bind("Asset_Owner_Email_ID") %>'></asp:TextBox>
<asp:RegularExpressionValidator ID="RegularExpressionValidator2"
runat="server" ErrorMessage="Please enter valid email for Asset Owner"
ValidationGroup="modify" ControlToValidate="txtamail"
ValidationExpression="^[A-Za-z0-9](([_\.\-]?[a-zA-Z0-9]+)*)@([A-Za-z0-9]+)(([\.\-]?[a-zA-Z0-9]+)*)\.([A-Za-z]{2,})$">*</asp:RegularExpressionValidator>
</EditItemTemplate>
<InsertItemTemplate>
<asp:TextBox ID="TextBox24" runat="server"
Text='<%# Bind("Asset_Owner_Email_ID") %>'></asp:TextBox>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="Label24" runat="server"
Text='<%# Bind("Asset_Owner_Email_ID") %>'></asp:Label>
</ItemTemplate>
<HeaderStyle HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:BoundField DataField="Asset_Owner_Contact_No"
HeaderText="Asset Owner Contact Number" HeaderStyle-HorizontalAlign="Left">
<HeaderStyle HorizontalAlign="Left"></HeaderStyle>
<ItemStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:BoundField DataField="Asset_Owner_Department_Unit"
HeaderText="Asset Owner Department" HeaderStyle-HorizontalAlign="Left">
<HeaderStyle HorizontalAlign="Left"></HeaderStyle>
<ItemStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:BoundField DataField="Service_Owner_Name"
HeaderText="Service Owner Name" HeaderStyle-HorizontalAlign="Left">
<HeaderStyle HorizontalAlign="Left"></HeaderStyle>
<ItemStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:BoundField DataField="Service_Owner_Contact_No"
HeaderText="Service Owner Contact Number"
HeaderStyle-HorizontalAlign="Left">
<HeaderStyle HorizontalAlign="Left"></HeaderStyle>
<ItemStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:TemplateField HeaderText="Service Owner EmailID">
<EditItemTemplate>
<asp:TextBox ID="txtsemail" runat="server"
Text='<%# Bind("Service_Owner_Email_ID") %>'></asp:TextBox>
<%--<asp:RegularExpressionValidator ID="RegularExpressionValidator1"
runat="server" ErrorMessage="Please enter valid email for Service Owner "
ValidationGroup="modify" ControlToValidate="txtsemail"
ValidationExpression="^[A-Za-z0-9](([_\.\-]?[a-zA-Z0-9]+)*)@([A-Za-z0-9]+)(([\.\-]?[a-zA-Z0-9]+)*)\.([A-Za-z]{2,})$">*</asp:RegularExpressionValidator>--%>
</EditItemTemplate>
<InsertItemTemplate>
<asp:TextBox ID="TextBox25" runat="server"
Text='<%# Bind("Service_Owner_Email_ID") %>'></asp:TextBox>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="Label25" runat="server"
Text='<%# Bind("Service_Owner_Email_ID") %>'></asp:Label>
</ItemTemplate>
<HeaderStyle HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:BoundField DataField="Service_Owner_Department_Unit"
HeaderText="Service Owner Department" HeaderStyle-HorizontalAlign="Left">
<HeaderStyle HorizontalAlign="Left"></HeaderStyle>
<ItemStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:BoundField DataField="Criticality" HeaderText="Criticality"
HeaderStyle-HorizontalAlign="Left">
<HeaderStyle HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:BoundField DataField="Asset_Transfer_Consideration" HeaderText="Transfer Consideration"
HeaderStyle-HorizontalAlign="Left">
<HeaderStyle HorizontalAlign="Left"></HeaderStyle>
<ItemStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:BoundField DataField="AMC_Warranty_Details" HeaderText="AMC/Warranty Details"
HeaderStyle-HorizontalAlign="Left">
<HeaderStyle HorizontalAlign="Left"></HeaderStyle>
<ItemStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:TemplateField HeaderText="Refresh Date">
<EditItemTemplate>
<asp:TextBox ID="txtenddate" runat="server"
Text='<%# Bind("Refresh_Date","{0:MM/dd/yyyy}") %>'></asp:TextBox>
<%--<asp:RegularExpressionValidator ID="rfvenddate" runat="server"
ControlToValidate="txtenddate"
ErrorMessage="Warranty End Date should be in YYYY-MM-DD format"
ValidationExpression="^[0-9]{4}-(((0[13578]|(10|12))-(0[1-9]|[1-2][0-9]|3[0-1]))|(02-(0[1-9]|[1-2][0-9]))|((0[469]|11)-(0[1-9]|[1-2][0-9]|30)))$"
ValidationGroup="modify">*</asp:RegularExpressionValidator>--%>
</EditItemTemplate>
<InsertItemTemplate>
<asp:TextBox ID="TextBox16" runat="server"
Text='<%# Bind("Refresh_Date","{0:MM/dd/yyyy}") %>'></asp:TextBox>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="Label16" runat="server"
Text='<%# Bind("Refresh_Date","{0:MM/dd/yyyy}") %>'></asp:Label>
</ItemTemplate>
<HeaderStyle HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:BoundField DataField="Server_Category" HeaderText="Server Category"
HeaderStyle-HorizontalAlign="Left">
<HeaderStyle HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:BoundField DataField="Upgraded_Category" HeaderText="Upgraded Category"
HeaderStyle-HorizontalAlign="Left">
<HeaderStyle HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:BoundField DataField="Year_Of_Refresh" HeaderText="Years Of Refresh"
HeaderStyle-HorizontalAlign="Left">
<HeaderStyle HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:BoundField DataField="Monthly_Refresh" HeaderText="Monthly Refresh">
<HeaderStyle HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:BoundField DataField="Method" HeaderText="Method">
<HeaderStyle HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:BoundField DataField="Approach" HeaderText="Approach">
<HeaderStyle HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:BoundField DataField="Target_State_Location"
HeaderText="Target State Location">
<HeaderStyle HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:BoundField DataField="To_Be_Backup_Location"
HeaderText="To Be Backup Location">
<HeaderStyle HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:TemplateField HeaderText="Transformation Planned Start Date">
<EditItemTemplate>
<asp:TextBox ID="txtplanstartdate" runat="server" Text='<%# Bind("Planned_StartDate") %>'></asp:TextBox>
</EditItemTemplate>
<InsertItemTemplate>
<asp:TextBox ID="TextBox10" runat="server"
Text='<%# Bind("Planned_StartDate") %>'></asp:TextBox>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="Label10" runat="server" Text='<%# Bind("Planned_StartDate") %>'></asp:Label>
</ItemTemplate>
<HeaderStyle HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Transformation Planned End Date">
<EditItemTemplate>
<asp:TextBox ID="txtplanenddate" runat="server" Text='<%# Bind("Planned_EndDate") %>'></asp:TextBox>
</EditItemTemplate>
<InsertItemTemplate>
<asp:TextBox ID="TextBox12" runat="server"
Text='<%# Bind("Planned_EndDate") %>'></asp:TextBox>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="Label12" runat="server" Text='<%# Bind("Planned_EndDate") %>'></asp:Label>
</ItemTemplate>
<HeaderStyle HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Transformation Actual Start Date">
<EditItemTemplate>
<asp:TextBox ID="txtactualstartdate" runat="server"
Text='<%# Bind("Actual_StartDate") %>'></asp:TextBox>
</EditItemTemplate>
<InsertItemTemplate>
<asp:TextBox ID="TextBox13" runat="server"
Text='<%# Bind("Actual_StartDate") %>'></asp:TextBox>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="Label13" runat="server" Text='<%# Bind("Actual_StartDate") %>'></asp:Label>
</ItemTemplate>
<HeaderStyle HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Transformation Actual End Date">
<EditItemTemplate>
<asp:TextBox ID="txtactualenddate" runat="server" Text='<%# Bind("Actual_EndDate") %>'></asp:TextBox>
</EditItemTemplate>
<InsertItemTemplate>
<asp:TextBox ID="TextBox14" runat="server" Text='<%# Bind("Actual_EndDate") %>'></asp:TextBox>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="Label14" runat="server" Text='<%# Bind("Actual_EndDate") %>'></asp:Label>
</ItemTemplate>
<HeaderStyle HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Current State of Transformation">
<ItemTemplate>
<asp:Label ID="Label15" runat="server" Text='<%# Bind("Current_Status") %>'></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList DataTextField="Current_Status" DataValueField="Current_Status"
ID="ddlcurrentstatus" Runat="server"
SelectedValue='<%# Bind("Current_Status") %>' AppendDataBoundItems="True" >
<asp:ListItem></asp:ListItem>
<asp:ListItem Value="NA">NA</asp:ListItem>
<asp:ListItem>WIP</asp:ListItem>
<asp:ListItem>Closed</asp:ListItem>
<asp:ListItem>Not Yet Started</asp:ListItem>
<%--<asp:ListItem>SE Owned</asp:ListItem>
<asp:ListItem>TCL Outsourced</asp:ListItem>--%>
</asp:DropDownList>
</EditItemTemplate>
<InsertItemTemplate>
<asp:TextBox ID="TextBox15" runat="server" Text='<%# Bind("Current_Status") %>'></asp:TextBox>
</InsertItemTemplate>
<HeaderStyle HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:BoundField DataField="Transformed_Asset_id"
HeaderText="Transformed AssetID">
<HeaderStyle HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:BoundField DataField="Transformation_Owners"
HeaderText="Transformation Owner ">
<HeaderStyle HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:BoundField DataField="Reasonfor_Dealy"
HeaderText="Reason for Dealy of Transformation">
<HeaderStyle HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:BoundField DataField="Serveronboard_Status"
HeaderText="Server Onboard Status">
<HeaderStyle HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:BoundField DataField="Remarks" HeaderText="Remarks">
<HeaderStyle HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="Left" />
<HeaderStyle HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="Left" />
</asp:BoundField>
</Fields>
</asp:DetailsView>
这是我的完整代码,它非常大。现在当我选择转换的当前状态为关闭时,应该启用转换后的资产 ID,否则应该禁用它。请在这方面帮助我。