Tag: 远程validation

远程归属validation不在Asp.Net MVC中触发

这是我的型号代码 public class BlobAppModel { [Required(ErrorMessage=”Please enter the name of the image”)] [Remote(“IsNameAvailable”,”Home”,ErrorMessage=”Name Already Exists”)] public string Name { set; get; } } 在我的控制器中我有 public JsonResult IsNameAvailable(string Name) { bool xx= BlobManager.IsNameAvailable(Name); if (!xx) { return Json(“The name already exists”, JsonRequestBehavior.AllowGet); } return Json(true, JsonRequestBehavior.AllowGet); } 在我的数据中我有 public static bool IsNameAvailable(string Name) { var test […]