Override EditorForModel Template
-
06-07-2019 - |
Question
You can provide alternate templates for individual types, but is it possible to override the template that wraps the label, field and validation up.
Change:
<div class="editor-label"><label for="Content">Content</label></div>
<div class="editor-field"><input class="text-box single-line" id="Content" name="Content" type="text" value="" /> </div>
To:
<div class="field">
<label for="Content">Content</label>
<input class="text-box single-line" id="Content" name="Content" type="text" value="" /> </div>
Rich
Solution
You can write an Object.ascx template and perform your own logic.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow