摘要: HtmlHelper方法是ASP.NET MVC中非常强大的特性,有了这个特性,我们就能更加随心所欲的定制自己的页面。 自定义自己的HtmlHelper方法通常有三种, 像是:一.Razor语法 采用Razor的方式非常直观,像是这样:@model IEnumerable<MusicShop.Models.Album>@{ ViewBag.Title = "Index";}@helper Truncate(string input, int length){ if (input.Length <= length) { @input; } else ... 阅读全文
posted @ 2013-03-30 19:41 文酱 阅读(10341) 评论(6) 推荐(2) 编辑