Esempio n. 1
0
        public ActionResult CheckUserInfo(string type, string value)
        {
            UserModel userModel = new UserModel();
            int returnKey = 0;
            string returnValue = "";

            if (type == "name" && userModel.CheckUserName(value) != null)
                returnValue = "用户名已存在";
            else if (type == "email" && userModel.CheckUserEmail(value) != null)
                returnValue = "邮箱已存在";
            else
                returnKey = 1;

            return Json(new { key = returnKey, value = returnValue }, JsonRequestBehavior.AllowGet);
        }