我总是使用New With {}
而没有任何问题。为什么会有所不同?
Razor 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