//This action method is called by the remote attribute from model to check if //the user is already registered by checking if the username already exists in db. public JsonResult ExistingUsername(string username) { bool usernameExists = userServices.ExistingUsername(username); return(Json(!usernameExists, JsonRequestBehavior.AllowGet)); }