开发者

Html.TextBoxFor change color value if error at login

I am new to mvc and I wonder how I can change the background color if the User do@html.TextBoxFor enter the wrong login. I'm using it quite simply.

@Html.TextBoxFor(m => m.Email, new {@class="caixa_login_email" })

How could add a new value for backgro开发者_开发百科und color?


If you have a [Required] attribute on the Email property, when the posted ModelState is invalid, the TextBox will have a class added to it like '.input-validation-error'

You could add a css style to change the background color:

.input-validation-error { background-color: #000; }

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜