摘要: @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) 编辑