ASP.NET MVC 3: do not publish form after remote validation

I'm going crazy! My code is too much to publish here, but the problem is simple: if I decorate the field of my model, the editing form does not work anymore (i.e., clicking the submit button, nothing happens).

I can post an expression and a remote confirmation function here:

[Required]
[Remote("CheckNomeAssociazione", "Associazioni")]
public string Nome { get; set; }

and this is the function:

public JsonResult CheckNomeAssociazione(string Nome)
{
    return Json(true, JsonRequestBehavior.AllowGet);
}

If I comment on the line [[Remote ...], the code will be perfect. If I let it in place, the application goes to the remote validator, but does nothing. Does anyone have the same or similar problem? thanks in advance Andrea

+2
source share
3 answers

, , , jQuery Validate 1.8. $.getJSON(), ( jQuery 1.5.2).

+1

:

[Remote("CheckNomeAssociazione", "Associazioni",HttpMethod = "POST")]

,

0

, . jQuery 1,5. , Remote. 1.4.4, , .

: jQuery Validate 1.7 breaks $.getJSON() jQuery 1.5?

0

Source: https://habr.com/ru/post/1789789/


All Articles