How to display a name after successful remote validation?
My business web application will have a lot of input controls where the
user is expected to enter some kind of code (Country, Zip, Employee ID,
etc.).
I'm using RemoteAttribute to validate code entries against my database to
ensure that users entered the correct code.
The thing is, my standard feature should be to display a name of entered
code if the remote validation is successful or error if the validation is
not successful.
I'm not sure how to do this.
The obvious answer is to send Name property along with true value in Json
object which jquery unobtrusive validation requires. The cshtml could look
something like this:
@Html.LabelFor(m => m.Country)
@Html.EditorFor(m => m.Country, new { data-codename-label="lbnCountry" })
<label ID="lbnCountry"></label>
I'm not sure how to implement such an idea though. Any help is appreciated.
No comments:
Post a Comment