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