[英]Display the text “…” in mvc view vb.net
Is there any way that you display the "..." text in a view in vb.net MVC. 有什么方法可以在vb.net MVC的视图中显示“ ...”文本。 For Example I am trying to do this:
例如,我正在尝试这样做:
@If item.IssueSummary.Length > 50 Then
@item.IssueSummary.Substring(0, Math.Min(item.IssueSummary.Length, 50)) @Html.DisplayName("...")
Else
@item.IssueSummary
End If
But the ... will not display like this (it will just be blank), Doing @Html.DisplayName("more") will work so is there anyway this can be displayed as text? 但是...不会像这样显示(它只是空白),执行@ Html.DisplayName(“ more”)可以,所以无论如何都可以将其显示为文本?
Just typing ... in the view gives and syntax error too. 只需在视图中输入...也会产生语法错误。
Just escape it like so... 像这样逃脱...
@if (true)
{
@:...
}
Hope this helps 希望这可以帮助
将字符串表达式放在方括号@(anystring)中应该可以:
@("...")
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.