每當我使用(@ Html.BeginForm()),如下面這個例子:MVC格式生成presnetation有害代碼
@using (Html.BeginForm())
{
@Html.DropDownList("test", Model.Select(p => new SelectListItem{ Text = p.Name, Value = p.ID}))
}
我得到這個錯誤:
Error 2 Cannot use local variable 'Html' before it is declared
並刪除了'@''之前Html' – ZippyV 2013-05-07 13:27:31
前@ZippyV'Html'你是什麼意思? – 2013-05-07 13:29:21
我是多麼愚蠢。謝謝 – rikket 2013-05-07 13:30:27