如何在MVC中放置一个空标签? [英] How to put an empty label in the MVC?

查看:68
本文介绍了如何在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!")


这篇关于如何在MVC中放置一个空标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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