jgauffin / griffin.mvccontrib

A contribution project for ASP.NET MVC3
http://blog.gauffin.org/tag/griffin-mvccontrib/
GNU Lesser General Public License v3.0
83 stars 40 forks source link

RemoteAttribute Unobstrusive Text #30

Closed rafakato closed 11 years ago

rafakato commented 11 years ago

When using RemoteAttribute with unobstrusive validation the text is not correctly shown, neither if I set my ErrorMessage on Attribute

rafakato commented 11 years ago

Please close this issue, I found a way to do what I want, sorry

jgauffin commented 11 years ago

Please write what you did

rafakato commented 11 years ago

I had to return the error message on JsonResult ie:

public JsonResult MyRemoteMethod(string valueToTest) { if (trueOrFalseMethod(valueToTest)) { return Json("Error message", JsonRequestBehavior.AllowGet); } return Json(true, JsonRequestBehavior.AllowGet); }