這是我的模型:asp.net的MVC 3遠程驗證問題
[Required(ErrorMessage = "Email required!")]
[Remote("EmailExists","User",ErrorMessage = "Email already")]
public virtual string Email { get; set; }
查看:
@Html.TextBoxFor(x => x.Email)
@Html.ValidationMessageFor(x => x.Email)
控制器:
public ActionResult EmailExists(string Email)
{
return Json(!Email.Equals("[email protected]"),
JsonRequestBehavior.AllowGet);
}
jquery.validate.min.js
和jquery.validate.unobtrusive.min.js
加入。並且也配置了web.config
。
當我輸入電子郵件輸入時,它觸發EmailExists
罰款。還返回true/false。 但訥韋爾顯示的ErrorMessage
而且我得到這個錯誤:
Erro: uncaught exception:
[Exception... "Cannot modify properties of a WrappedNative"
nsresult: "0x80570034 (NS_ERROR_XPC_CANT_MODIFY_PROP_ON_WN)"
location: "JS frame :: chrome://global/content/bindings/autocomplete.xml ::
onxblpopuphiding :: line 848" data: no]
任何想法?
感謝達林...我發現這個問題......這是jquery.validate版本...我使用jQuery 1.5.1和jquery.validate 1.7 ...所以我更新到1.8,一切正常... ... – Paul 2011-04-07 12:24:11