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

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -