ASP.NET MVC Required Field Indicator
For fields in my ASP.NET MVC view that have been attributed as required, is there any way for the framework to render some sort of indicator automatically that the field is marked as required in metadata? Should be able to do this with CSS since MVC3 adds in those custom attributes to the element: <input data-val="true" data-val-required="The Username field is required." id="Username" name="Username" type="text" value="" /> You could key off the data-val-required in CSS like so: input[data-val-required] { background:red } or set a background image of an asterisk etc. I did that way because my