Html inside label using Html helper
问题 How can I add inline html elements inside a label with Html.Label? 回答1: Looks like a good scenario for a custom helper: public static class LabelExtensions { public static MvcHtmlString LabelFor<TModel, TProperty>( this HtmlHelper<TModel> htmlHelper, Expression<Func<TModel, TProperty>> ex, Func<object, HelperResult> template ) { var htmlFieldName = ExpressionHelper.GetExpressionText(ex); var for = htmlHelper.ViewContext.ViewData.TemplateInfo.GetFullHtmlFieldName(htmlFieldName); var label =