asp.net mvc - Mvc 4 validation summary errors not displaying -
i having trouble displaying validation summary, want display errors in validation summary, not beside field. in view have,
@html.validationsummary() @html.validationmessagefor(m =>m.name)
in controller have
modelstate.addmodelerror("name", "name required");
am not supposed validation error message? @ top? don't missing...
i including these script files.. jquery.validate.min.js jquery.validate.unobtrusive.min.js
try
@html.validationsummary(false)
so not exclude property errors.
or
try method @xurca linked add model error empty key not tied specific property.
modelstate.addmodelerror(string.empty, "name required");
Comments
Post a Comment