Answer the question
In order to leave comments, you need to log in
Why doesn't ModelState.IsValid become False even though Remote returns false?
Why doesn't ModelState.IsValid become false even though Remote returns false?
Is the check done for enough money in the account for the transaction?
Model:
[Required(ErrorMessage = "Введите сумму ставки")]
[Range(MinBetSum, MaxBetSum, ErrorMessage = "Сумма от 50 до 50000")]
[Remote(action: "InCash", controller: "Validate", ErrorMessage = "Недостаточно средств")]
public decimal Sum{ get; set; }
ModelState.IsValid == false
[AcceptVerbs("Get")]
public async Task<JsonResult> InCash(decimal Sum)
{
User user = await db.Users.FirstOrDefaultAsync(u => u.Username == User.Identity.Name);
bool res = user.Balance >= Sum;
return Json(res);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question