protected void dvDataSource_Inserting(object sender, ObjectDataSourceMethodEventArgs e) { Deal d = e.InputParameters["entityToInsert"] as Deal; DealController.ValidateInsertCode(d.Code); }