I’m using MVC2, Preview 2. Why is it that when I use:
<%= Html.LabelFor(x => x.Nombres) %>
<%= Html.Encode(Model.Nombres) %>
It outputs:
Nombre:
Sr. Fulano de Tal
But when I use:
Nombres:
<%= Html.Encode(Model.Nombres) %>
it outputs:
Nombre: Sr. Fulano de Tal
I don’t want the return after the label. Is it my CSS that is ruining things, or is it the HTML.LabelFor that is producing the extra return.
This is really hard to answer. Could do with seeing the actual html markup it is producing. I suspect the labels are either floated or display:block in the css.