請看這裏Darin的解決方案.. Converting HTML.EditorFor into a drop down (html.dropdownfor?)問題轉化editorfor爲DropDownList
我不能讓下拉列表的工作。請有任何幫助。謝謝。
我在我的ascx頁面收到BC30203錯誤。
BC30203:預期標識符。 (第4行 - 新[])..我用什麼來代替模型。我試圖把實際的型號名稱,可我得到的語法錯誤..這代碼根據上面張貼的解決方案鏈接出現在編輯模板...
代碼:
<%= Html.DropDownList(
"",
new SelectList(
new[]
{
new { Value = "true", Text = "Yes" },
new { Value = "false", Text = "No" },
},
"Value",
"Text",
Model
)
) %>
你試過了嗎? [解決方案] [1] [1]:http://stackoverflow.com/questions/781987/how-can-i-get-this-asp-net-mvc-selectlist-to-work – tetuje 2012-03-05 14:19:24