摘要: 效果如下:其实截取方法跟aspx页面中一样,不管是用C#还是js或者CSS都可以实现,我在这里只是想记录在MVC中怎么用的两种方法:方法一:先新建一个类然后编写以下方法:public static class HtmlHelpers{public static string Truncate(this HtmlHelper helper, string input, int length){if (input.Length <= length){return input;}else{return input.Substring(0, length) + "...";} 阅读全文
posted @ 2011-05-25 11:44 peter cheng 阅读(1927) 评论(7) 推荐(2) 编辑