I’m using a editor template for a object called Address.
@Html.EditorFor(model => model.Address)
In the template I have a few text boxes for the information about the user address.
this is how the text boxes are written in template
<p class="clear">
<label for="zip">
<span>@Html.LabelFor(x => x.ZipCode)</span>
@Html.TextBoxFor(m => m.ZipCode, new { @class = "big zip" })
</label>
</p>
but when it’s rendered they broke my CSS putting
<div class="editor-label"> AND <div class="editor-field">
in the place of my paragraph tags.
There’s any way I could change that?
I don’t think your editor template is actually being used. Those are the default template values. You will have to provide some more information about your template in order to help. Where is it located? What is it called? etc.. (update your question, don’t add this information as a comment)
What you would normally do is have a file called Address.cshtml and place this in a folder called EditorTemplates, either in the same folder as the view you are referencing, or in the Shared views folder if you need to share this template across various folders.
You should also add an
@model Addresss(or whatever the fully qualified namespace is).BTW, you are two labels being generated. That’s not semantically correct.