I have a simple view model
public string LinkName { get; set; }
[Display(Name = "Url")]
[DataType(DataType.Url)]
public string Link
{
get
{
return string.Format(/*some link building logic*/);
}
}
But when I try to display it in view with
@Html.DisplayFor(m => m.Link)
I'm getting whole Url displayed and I'd like to just display LinkName i.e something like this
<a href="http://...">http://...</a>
but I'd like to have it like this:
<a href="http://...">LinkName</a>