摘要: 在页面上要添加以下js引用否则验证失效 阅读全文
posted @ 2012-03-30 11:42 kevinzw 阅读(325) 评论(0) 推荐(0) 编辑
摘要: VIEW 代码@using (Html.BeginForm("Upload", "UploadFile", FormMethod.Post, new { enctype = "multipart/form-data" })){}Controller 代码 [HttpPost] public ActionResult Upload(HttpPostedFileBase file) { if (file != null && file.ContentLength > 0) { // extract only the 阅读全文
posted @ 2012-03-26 11:20 kevinzw 阅读(289) 评论(0) 推荐(0) 编辑
摘要: public static IQueryable WHEREIF(this IQueryable source, Expression> filter, bool isEmpty) { return isEmpty ? source.Where(filter) : source; } 阅读全文
posted @ 2012-03-19 11:03 kevinzw 阅读(333) 评论(0) 推荐(1) 编辑
摘要: public string RunRegisterNoParam(string strRegisterUrl, string param) { string strRen = ""; try { CookieContainer container = new CookieContainer(); HttpWebRequest request = (HttpWebRequest)WebRequest.Create(strRegisterUrl + "?" + param); request.CookieContainer = container; requ 阅读全文
posted @ 2011-09-28 15:42 kevinzw 阅读(448) 评论(0) 推荐(0) 编辑
摘要: 在 我们从业务逻辑层获得数据实体时候,接下来的事情就是要绑定到控件中。数据实体中的一些字段可以直接绑定到界面中,但是有一些字段需要重新格式化格式。比 如货币单位字段,需要显示货币符号和每隔三位显示分隔符;再比如日期字段,数据库中存放的是日期和时间,但是在界面上需要按照XXXX年XX月XX日的格 式显示。这时候我们就用到了DataFormatString属性。例如上面的代码展示了日期和货币两种绑定方式。DataFormatString中的{0}是固定的格式,这和String.Fromat(“{0}”, someString)中的{0}是一个用法,表示绑定上下文的参数索引编号。然后,在后面加入格式 阅读全文
posted @ 2011-09-28 15:31 kevinzw 阅读(1338) 评论(0) 推荐(0) 编辑
摘要: [关闭] 阅读全文
posted @ 2011-09-13 15:01 kevinzw 阅读(385) 评论(0) 推荐(0) 编辑
摘要: 点击这里打开窗口 阅读全文
posted @ 2011-09-13 14:56 kevinzw 阅读(2748) 评论(0) 推荐(0) 编辑