asp.net mvc 2 - Adding more than one key for the same ModelState error -


i've been looking solution while , i'd ask what's best way that.

suppous have 2 fields filled date , period invalid.

after discovering need send user error , need highlight field related error.

if((seconddate.value - firstdate.value).days > 31) {   modelstate.addmodelerror("firstdate", "the period must contains less 31 days"); } 

with this, "firstdate" field works nicelly , make "seconddate" field have same behave.

is possible? wich best that?

thanks !

if((firstdate.value - seconddate.value).days > 31) {     modelstate.addmodelerror("firstdate", "the period must contains less 31 days");     modelstate.addmodelerror("seconddate", "the period must contains less 31 days"); } 

Comments

Popular posts from this blog

Python __call__ special method practical example -

How can I edit my VIM config so that Vim treats ".ejs" files the same as it currently treats my html files? -