0
昨天我提出以下問題Html.Dropdown - get the the value of each option to be the same as the text?時,我發現這是回答下面的帖子What HTML helper do I use to create a simple dropdownlist that doesn't take in any variables? 現在這一切都很好但是,我怎麼會選擇一個默認值(如每月),這裏是我的代碼...ASP.NET MVC Html.Dropdown - 設置默認值
<%: Html.DropDownList("day", new SelectList(
new Dictionary<string,string> { { "Weekly", "Weekly" }, { "Monthly", "Monthly" }, { "Quarterly", "Quarterly" }, { "Annually", "Annually" } },
"Key", "Value"))
%>
任何幫助,因爲我還沒有找到一個例子來說明這個簡單的要求,將不勝感激,也許我應該對MVC購買一本書嗎?