Is it possible use a HtmlHelper to display only a few characters of the text? how can I do this?

有帮助吗?

解决方案

Something like this?

public static MvcHtmlString SubString(this HtmlHelper helper, string theString, int length)
{
  return MvcHtmlString.Create(theString.Substring(0,length));
}
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top