Ciaran Donoghue
Ciaran Donoghue

Reputation: 828

Display the text "..." in mvc view vb.net

Is there any way that you display the "..." text in a view in 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?

Just typing ... in the view gives and syntax error too.

Upvotes: 0

Views: 63

Answers (2)

user1023602
user1023602

Reputation:

Putting the string expression in brackets @(anystring) should work:

 @("...")

Upvotes: 0

heymega
heymega

Reputation: 9401

Just escape it like so...

@if (true)
{
    @:...
}

Hope this helps

Upvotes: 2

Related Questions