摘要:
我们一般把通用的组件放在Shared文件夹下@{ var model = ViewData["dataSource"] as IDictionary<string, string>; var selectedItem = ViewData["selected"] == null ? string.Empty :ViewData["selected"].ToString();}<select class="@ViewData["className"] SelectWrapper" 阅读全文
摘要:
在项目中,经常用到自定义的控件.引入命名空间 :using System.Web.Mvc;public static MvcHtmlString UIAction(this HtmlHelper helper, string value, string href, string width, string cssClass, object htmlAttributes) { StringBuilder ui = new StringBuilder(); ui.AppendFormat("<input"); ui.AppendFormat(" type= 阅读全文