Extend MVC LabelFor Method

The LabelFor method provides strongly typed labels using lambda expressions. Unfortunately, the default MVC one doesn't provide a way to add extra attributes and if you don't want the text from the field variable you have to use the DisplayNames data annotations.
The method here uses the variable name or data annotation DisplayName, but allows the Camel Case variable to be split into words, add a colon to the end, add extra text, and/or specify an id value for the label.

Note, the "Inflector.Titleize(labelText)" is a UCDArch method to convert Camel case to titleized (first letter capitalized of each word) strings.

When:

Where:

Contact

Computing Resources Unit

The Computing Resources Unit provides the best possible customer service, application development, and technology infrastructure to support the business needs of the Dean’s Office and the College of Agricultural & Environmental Sciences and its departments.