上一页 1 ··· 20 21 22 23 24 25 26 27 28 ··· 37 下一页
摘要: Open the Movie.cs file. The System.ComponentModel.DataAnnotations namespace provides formatting attributes in addition to the built-in set of validation attributes. You'll apply the DisplayFormat attribute and a DataType enumeration value to the release date and to the price fields. The followin 阅读全文
posted @ 2011-07-04 13:33 Ken-Cai 阅读(2587) 评论(0) 推荐(0) 编辑
摘要: @using (Html.BeginForm()){ <p>销售状态: @Html.DropDownList("Status", "All") &nbsp; <input type="submit" value="Filter" /></p> } public ActionResult Index(string status) { ViewBag.Status = PowerCar.DB.Enums.MerchandiseStatus.StatusList; String 阅读全文
posted @ 2011-07-04 12:00 Ken-Cai 阅读(264) 评论(0) 推荐(0) 编辑
摘要: 1. 上传大文件 http://www.cnblogs.com/lucslg/archive/2011/06/26/2090885.html 2. 在asp.net mvc中使用Uploadify上传文件 http://www.cnblogs.com/dingji/archive/2010/07/07/1772909.html3. JQuery 上传插件Uploadify 使用详解 http://www.cnblogs.com/dingji/archive/2010/07/07/1772909.html4. Uploadify的官方网站 http://www.uploadify.com/5. 阅读全文
posted @ 2011-06-30 15:24 Ken-Cai 阅读(674) 评论(0) 推荐(0) 编辑
摘要: 1. 直接在页面初始化 @Html.DropDownListFor(model => model.Status, new SelectList(new string[] {"正常", "暂停销售"}))2.从数据库中读取 Text Valuehttp://code-inside.de/blog-in/2010/12/25/howto-apply-mvc2-html-dropdownlistfor/5. 与 enum 的联系 http://www.dotblogs.com.tw/jed/archive/2010/09/12/mvc_dropdownl 阅读全文
posted @ 2011-06-30 10:56 Ken-Cai 阅读(3902) 评论(0) 推荐(0) 编辑
摘要: [HttpPost] public ActionResult RemoveFromCart(int id) { // Remove the item from the cart var cart = ShoppingCart.GetCart(this.HttpContext); // Get the name of the album to display confirmation string albumName = storeDB.Carts .Single(item => item.RecordId == id).Album.Title; // Remove from cart i 阅读全文
posted @ 2011-06-25 10:49 Ken-Cai 阅读(359) 评论(0) 推荐(0) 编辑
摘要:  Required – Indicates that the property is a required field DisplayName – Defines the text we want used on form fields and validation messages StringLength – Defines a maximum length for a string field Range – Gives a maximum and minimum value for a numeric field Bind – Lists fields to exclude 阅读全文
posted @ 2011-06-25 09:45 Ken-Cai 阅读(164) 评论(0) 推荐(0) 编辑
摘要: public ActionResult Create(){ViewBag.GenreId = new SelectList(db.Genres, "GenreId", "Name");ViewBag.ArtistId = new SelectList(db.Artists, "ArtistId", "Name");return View();}@Html.DropDownList("GenreId", String.Empty) 阅读全文
posted @ 2011-06-25 09:21 Ken-Cai 阅读(1029) 评论(0) 推荐(1) 编辑
摘要: public string Browse(string genre){string message = HttpUtility.HtmlEncode("Store.Browse, Genre = " + genre);return message;} 阅读全文
posted @ 2011-06-23 11:44 Ken-Cai 阅读(203) 评论(0) 推荐(0) 编辑
摘要: @model IEnumerable<MvcMusicStore.Models.Album>@helper Truncate(string input, int length){if (input.Length <= length) { @input} else { @input.Substring(0, length)<text>...</text>}}@{ViewBag.Title = "Index"; }<h2>Index</h2><p> @Html.ActionLink("Cre 阅读全文
posted @ 2011-06-15 15:54 Ken-Cai 阅读(311) 评论(0) 推荐(0) 编辑
摘要: public ActionResult Create(){ViewBag.GenreId = new SelectList(db.Genres, "GenreId", "Name");ViewBag.ArtistId = new SelectList(db.Artists, "ArtistId", "Name");return View();}@Html.DropDownList("GenreId", String.Empty) 阅读全文
posted @ 2011-06-15 15:24 Ken-Cai 阅读(257) 评论(0) 推荐(0) 编辑
上一页 1 ··· 20 21 22 23 24 25 26 27 28 ··· 37 下一页