Approach to implementing an AJAX callback to check say for duplicate records....
Hi,
One of the things we have a need to do quite often is check some form of "complex" validation client side that ultimately does not relate to only the view model being edited. Common examples might include:
- Checking for duplicates (ie is login name taken)
- Checking for association (ie is adding this record allowed based on a collection of other data)
So I was thinking of building a validator and in essence passing the necessary information to the client side which would then invoke a '.ajax' call back to the server which would ultimately do the heavy lifting.
Are there any issues with this approach or is there a better way? Or has someone already done something similair?
Bump!
It's probably too late, nevertheless please excuse the lack of earlier response. There was an ongoing discussion under the following thread long time ago. As a result of that the first approach to asynchronous validation was implemented in the async-work branch, which is mentioned in the documentation. Currently there are no plans for merging this code into the master because it is still in a non-production stage, and probably this is not going to change anytime soon.
Thanks I will have a look.