1
我一直使用New With {}
沒有問題。爲什麼這是不同的?爲什麼新建<Type>使用{}工作但New With {}不工作?
剃刀VB.NET代碼
Using Ajax.BeginForm(New AjaxOptions With {.HttpMethod = "Post"})
@* no problem *@
End Using
Using Ajax.BeginForm(New With {.HttpMethod = "Post"})
@* Value of type '<anonymous type>' cannot be converted to 'System.Web.Mvc.Ajax.AjaxOptions'. *@
End Using