03 2012 档案

摘要:在Share/EditorTemplates中新增View,名为Enum.cstml内容如下 1 @using MvcApp.Infrastructure 2 @model Enum 3 4 @Html.DropDownListFor(m => m, Enum.GetValues(Model.GetType()) 5 .Cast<Enum>() 6 .Select(m => { 7 string enumVal = Enum.GetName(Model.GetType(), m); 8 return new SelectListItem() 9 {10 Sel... 阅读全文
posted @ 2012-03-11 09:46 mayamoon 阅读(524) 评论(0) 推荐(0)
摘要:1.分页扩展方法1.1定义 1 public static MvcHtmlString PageLinks(this HtmlHelper html, 2 PagingInfo pagingInfo, 3 Func<int, string> pageUrl) { 4 StringBuilder result = new StringBuilder(); 5 for (int i = 1; i <= pagingInfo.TotalPages; i++) { 6 TagBuilder tag = new TagBuilder("a"); // Constru 阅读全文
posted @ 2012-03-03 13:22 mayamoon 阅读(189) 评论(0) 推荐(0)