我一直用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