如何在MVC中放置一个空标签?
问题描述:
我正在尝试做这样的事情
I am trying to do something like this
Html.label("",new {id = "labelId"})
但它不起作用请告诉我如何做到这一点,或者如果这个问题已经被问到,请给我链接我无法找到一个。
but it is not working please tell me how i can do this or if this question had already been asked then give me the link i am unable to find one.
答
我不知道你想要达到的目的但是希望它能满足您的需求
@ Html.Label()
如果你想用标签显示文字
@ Html.Label(嗨!)或@ Html.DisplayName(嗨!)
I dont know what you trying to achieve but try this hope it what you looking for
@Html.Label("")
if you want to display text using the label
@Html.Label("Hi!") or @Html.DisplayName("Hi!")