I'm having some difficulty with getting the clientside validation to work on a .net core mvc app. It's hitting my required-if annotation rule server-side. I've started through the debugging suggestions, and I never get to the breakpoint on "computeRequiredIf" I believe because no data-val-requiredif* attributes are getting added to the generated html elements. With the .net core, there's no more global.asax and Application_start to add the ExpressiveAnnotationModelValidatorProvider, but it is working serverside, so maybe that's not the issue. Any thoughts on what I did to cause the omission of attributes?
I'm just using the stock EditorFor helper, and here's the model property definition:
[MaxLength(50)][Display(Name = "Name")][RequiredIf("shortAnswer3 == 'Yes'", ErrorMessage = "Required if you would like a response.")]public string shortAnswer4 { get; set; }
I'm having some difficulty with getting the clientside validation to work on a .net core mvc app. It's hitting my required-if annotation rule server-side. I've started through the debugging suggestions, and I never get to the breakpoint on "computeRequiredIf" I believe because no data-val-requiredif* attributes are getting added to the generated html elements. With the .net core, there's no more global.asax and Application_start to add the ExpressiveAnnotationModelValidatorProvider, but it is working serverside, so maybe that's not the issue. Any thoughts on what I did to cause the omission of attributes?
I'm just using the stock EditorFor helper, and here's the model property definition:
[MaxLength(50)]
[Display(Name = "Name")]
[RequiredIf("shortAnswer3 == 'Yes'", ErrorMessage = "Required if you would like a response.")]
public string shortAnswer4 { get; set; }