protected void dvDataSource_Updating(object sender, ObjectDataSourceMethodEventArgs e) { Damage d = e.InputParameters["newEntity"] as Damage; int policyItemID = Convert.ToInt32(e.InputParameters["PolicyItemID"]); TextBox tbPolicyNumber = DetailsView1.FindControl("tbPolicyNumber") as TextBox; string policyNumber = tbPolicyNumber.Text; DropDownList ddlInsuranceSubTypes = DetailsView1.FindControl("ddlInsuranceSubTypes") as DropDownList; int insuranceSubTypeID = Convert.ToInt32(ddlInsuranceSubTypes.SelectedValue); DropDownList ddlInsuranceCompanies = DetailsView1.FindControl("ddlInsuranceCompanies") as DropDownList; int insuranceCompanyID = Convert.ToInt32(ddlInsuranceCompanies.SelectedValue); DamageController.ValidateUpdateDamageNumber(d.ID, d.DamageNumber, policyNumber, insuranceSubTypeID, insuranceCompanyID, policyItemID); }