I am using ASP.NET MVC 2.
Html.DropDownListFor and Html.TextArea For automatically getting red borders when validation fails.
How to make the four borders of a TextBox (using Html.TextBoxFor) red if it fails validation?
For example, I have a TextBox that is required, and when the user submits the form without specifying a value in the text box, I want the text box to have red borders.
- html. html, ( firebug) *. css, .
. :
input.input-validation-error, textarea.input-validation-error, select.input-validation-error { background: #FEF1EC; border: 1px solid #CD0A0A; }
HTHS,
* , ASP.NET MVC input-validation-error.
input-validation-error
, , CSS :
.input-validation-error { border: 1px solid #ff0000; background-color: #ffeeee; }
Source: https://habr.com/ru/post/1745357/More articles:How to use reflection to call a method and pass parameters whose types are unknown at compile time? - reflectionDo I need to install Glassfish? - java-eeFinding Twitter best friends using Python - pythonFilling PrimaryIdentity in WCF - securityFix SQL query that is ugly and confusing - sqlNeed help with a map (C ++, STL) - c ++https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1745359/svn-server-hosting-company-shutting-down-and-i-need-a-backup-of-repository&usg=ALkJrhjx_gqqSN7WR5QFAiLKQj0AApsheAC # IndexOutOfRange problem, possibly simple - c #How can I execute this collection, group by query in LINQ? - c #https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1745362/things-to-keep-in-mind-during-application-migration-coldfusion-to-spring&usg=ALkJrhgt-PCnLwTpcF8i-wJ8jN1PxIk4FgAll Articles