7
Vote

Respect model metadata and model validation in html helper controls

description

Hi,
It would be nice if HtmlHelper control respect ModelMetadata and ModelValidation. I think about adding:
  • maxlength attribute in TextBox or TextArea if property has StringLengthAttribute
  • title attribute if ModelMetadata has Description
  • placeholder attribute if ModelMetadata has Watermark
  • any others/ability to extend that

comments

wittml wrote Mar 8 at 4:45 PM

Not having this type of feature (specifically for MaxLength or StringLength) causes a lot of violations of DRY.

TrivediVishal wrote Nov 9 at 10:10 AM

This feature is very necessary for representing the model accurately in the view as intended by the model creator. Having this feature in built would save lot of time and effort for developers like me who have to tweak their code to manually implement this.