MVC學習三

    第六節,建立的是查詢頁面,學習的所得,(1)更改調試初始頁面,應該在app_start中的RouteConfig中修改;(2)驗證的element;(3)後臺方法重載貌似報錯(4)
@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中方法,在調試相對的頁面

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章