I'm using Remote Attribute in my Model to check duplicate Page Titles as follows
public class Page
{
[Remote("CheckDuplicate", "Page", ErrorMessage = "Title already taken")]
public string Title { get; set; }
}
And In controller, I'm returning JsonResult data based on "Check" result as follows:
public JsonResult CheckDuplicate(string Title)
{
var result = db.Pages.Where(a => a.Title == Title).Count() == 0;
return Json(result, JsonRequestBehavior.AllowGet);
}
This is working fine in Create action, But problem is, It's restricting me to Edit the Existing page, Since It's checking the same query.
How to solve this Problem? Please Suggest me something