@Html.ActionLink("Create New", "Create")
@using (Html.BeginForm("SearchIndex","Movies",FormMethod.Get)){
<p>Genre: @Html.DropDownList("movieGenre", "All")
Title: @Html.TextBox("SearchString")
<input type="submit" value="Filter" /></p>
}
(5)GenreLst.AddRange(GenreQry.Distinct()); Distinct是隻取唯一;(6)ViewBag.movieGenre=newSelectList(GenreLst);是綁定到頁面的dropdownlist;(7)在controller中添加相應的頁面時,最好先編輯controller中方法,在調試相對的頁面