我看到BeginForm
具有以下签名的方法的重载:
(扩展名)MvcForm HtmlHelper.BeginForm(字符串actionName,字符串ControllerName,FormMethod方法)
我named-arguments
在调用时使用类似
@using (Html.BeginForm(actionName:"Index", controllerName:"Home", FormMethod.Get))
但是,我不断收到这样的错误:
CS1738: Named argument specifications must appear after all fixed arguments have been specified
有什么想法我要去哪里错吗?
谢谢。
您还需要为最后一个参数指定参数名称:
@using (Html.BeginForm(actionName:"Index", controllerName:"Home", method:FormMethod.Get))
// ↖ parameter name
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句