2

In our application our customers are allowed to define a couple of reference fields, and the validation for these reference fields by way of a regular expression. The Validation Regex is saved into our database.

What is the best way to apply this regex as validation for an MVC text box field?

1 Answer 1

3

In addition to checking server-side when the value's submitted, you can use remote validation which would create a round-trip to test the current value against logic stored on the server (or in this case in a database).

Have a look at the RemoteAttribute and that MSDN article above (which includes an example).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.