I have a ViewModel class, for example:
class CaseModel {
public Boolean ClientPresent { get; set; }
public ClientModel Client { get; set; }
}
class ClientModel {
[Required]
public String FirstName { get; set; }
[Required]
public String LastName { get; set; }
}
The browse page consists of a partial view <input type="checkbox" name="ClientPresent" />and Html.EditorFor( m => m.Client ).
The idea is that when the user, providing information about the case (object of a business domain), can choose not to specify any information about the client (another object-object), unchecking the ClientPresent box.
, ASP.NET MVC ClientModel, CaseModel.Client , , FirstName LastName aren ' t (), , , [Required], ViewData.ModelState.IsValid false, .
, CaseModel.Client , CaseModel.ClientPresent - false?
, ClientModel ViewModel (, ClientController, ).