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

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -