I have the following code for a textbox on a page
C#@(
Html.DevExtreme()
.TextBox()
.ID("txtWidgetName")
.ValidationMessageMode(ValidationMessageMode.Always)
.ValidationError("Enter a valid widget name")
.MaxLength(100)
)
In javascript, I validate the control text and set isValid accordingly.
I am not using databinding/attributes to validate.
However when isValid is set to false, whilst the textbox style changes to indicate that validation has failed, I am not seeing a message.
Reading through the documentation, I understand my approach is not correct.
It appears that to any widget that needs validation must be created in a JS file as there is no Html.DevExtreme().Validator that can be added on a page.
Am I understanding this correctly?
Also can you confirm that validation using these widgets does not work like your other MVC server controls.
Ultimately, I just want to show a message once a textbox fails validation and isValid is set to false.
Would appreciate your input on this.
Many thanks
Abdul