I have a complication to display a ValidationMessageFor or mvc span, I have a ajax method to check for an id bd and it returns a Boolean me, this result if there want this.
function ExistProduct() {
$.ajax({
type: 'GET',
url: "/Products/ExistProduct",
contentType: "application/json;charset=utf-8",
data: JSON.stringify({ "id": id }),
datatype: "json",
success: function (data) {
if (data.exist == true) {
// show ValidationMessageFor
}
else {
}
}
});
}
as I can resolve this and not allow submit apply and save
RemoteAttributeHow to: Implement Remote Validation in ASP.NET MVC. Dont try and reinvent the wheel