Looks like a good scenario for a custom helper:
public static class LabelExtensions
{
public static MvcHtmlString LabelFor(
this HtmlHelper htmlHelper,
Expression> ex,
Func
and then:
@Html.LabelFor(
x => x.Name,
@Hello World
)
UPDATE:
To achieve what you asked in the comments section you may try the following:
public static class HtmlHelperExtensions
{
public static MvcHtmlString LabelFor(this HtmlHelper htmlHelper, Expression> ex, Func
and then:
@Html.LabelFor(
x => x.Name,
@mandatory
)