In my model I have the below property
public int? Data
{
get;
set;
}
and using @Html.TextBoxFor(m => m.Data) I am adding it in the view.
I have another property in the model
public DateTime? DateData { get; set; }
which I display using @Html.FormTextBoxFor(m => m.DateData, new { id = "DateData " })
How can I use the RequiredIf attribute or any other method to make the DateData required if the value of Data is not 0. So anytime the value of Data is not zero or null I want the DateData to be a required property.
RequiredIfis not something that is provided by vanillaasp.net-mvcrequiring one to use a third party / custom implementation. It would be helpful if you could provide a link to theRequiredIfimplementation you chose.