为什么Html.Label()无法与句点一起使用? [英] Why does Html.Label() not work with periods?
本文介绍了为什么Html.Label()无法与句点一起使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用Html.Label(strings)输出一些字符串.
I'm outputting a fews strings using Html.Label(strings).
当我给它传递一个带有句点的值时,它只输出空格
When I pass it a value with a period in it, it outputs nothing but spaces
Html.Label(公司)
Html.Label(company)
例如<%:Html.Label("Bill Co.")%>
公司是一个动态值,如果值是"Bill Co",它将起作用,但如果它是"Bill Co.",则不会起作用,唯一的区别是该期间.
Company is a dynamic value, it will work if the value is "Bill Co" but not if it is "Bill Co.", the only difference is that period.
我应该能够按照通过msdn的HhtmlHelper.Label
I should be able to pass any string to it as per HhtmlHelper.Label via msdn
public IHtmlString Label(
string labelText
)
有什么想法吗?
推荐答案
我使用ToHtmlString()并解决了该问题.
I used ToHtmlString() and that solved the issue.
谢谢
这篇关于为什么Html.Label()无法与句点一起使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文