< BR>在@ Html.LabelFor标签? [英] <br> tag in @Html.LabelFor?

查看:181
本文介绍了< BR>在@ Html.LabelFor标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图分裂成拉布勒两行。但是,如果把结果在 @ Html.LabelFor 它不工作有什么替代方案?

控制器

  meetingAbstract.AbstractTitleInEnglishLabel = meetingQuestionses [0] .question_text
                           +/+ meetingQuestionses [0] .question_text_en;

视图

  @ Html.LabelFor(型号=> model.AbstractTitleInEnglishLabel,
   Model.AbstractTitleInEnglishLabel,新{@class =控制标签强制})


解决方案

我想创建一个自定义的HtmlHelper。

继承 IHtmlString ,并使用 TagBuilder 来创建一个。

然后你可以用 @ Html.CustomLabelFor使用它(...)

I am trying to split lable into two lines. But if put
in the @Html.LabelFor it is not working is there any alternative options?

controller

meetingAbstract.AbstractTitleInEnglishLabel = meetingQuestionses[0].question_text 
                           + "/" + meetingQuestionses[0].question_text_en;

view

 @Html.LabelFor(model => model.AbstractTitleInEnglishLabel, 
   Model.AbstractTitleInEnglishLabel, new { @class = "control-label mandatory" })

解决方案

I would create a custom HtmlHelper.

Inherit IHtmlString and use TagBuilder to create one.

Then you can use it with @Html.CustomLabelFor(...).

这篇关于< BR>在@ Html.LabelFor标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆