Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/293.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 强类型通知Lambda问题_C#_Asp.net Mvc_Linq_Lambda_Html Helper - Fatal编程技术网

C# 强类型通知Lambda问题

C# 强类型通知Lambda问题,c#,asp.net-mvc,linq,lambda,html-helper,C#,Asp.net Mvc,Linq,Lambda,Html Helper,我有以下代码,并且收到一个intellisense错误:“无法将lambda表达式转换为'System.Linq.Expressions.expression>'类型,因为它不是委托类型” 这在过去是有效的,但是有些事情已经改变了,我现在遇到了这些问题 @using (Html.BeginForm<EmployersController>(c => c.CompanyDetails(null, null), FormMethod.Post, new { @class = "bc

我有以下代码,并且收到一个intellisense错误:“无法将lambda表达式转换为'System.Linq.Expressions.expression>'类型,因为它不是委托类型”

这在过去是有效的,但是有些事情已经改变了,我现在遇到了这些问题

@using (Html.BeginForm<EmployersController>(c => c.CompanyDetails(null, null), FormMethod.Post, new { @class = "bcms-ajax-form" }))
{     
}
@使用(Html.BeginForm(c=>c.CompanyDetails(null,null),FormMethod.Post,new{@class=“bcms ajax form”}))
{     
}

我认为这里可能有更多您没有显示的代码导致了您的问题。删除
(null,null)
您为什么要使用这种方法?“你想达到什么目的?”Shyju,我一开始不记得我为什么使用这种方法,但我记得这是必要的。我想我只是想尝试使用BeginForm([actionName]、[ControllerName]、[Method]、[HtmlAttributes])。当然,保持HTML表单简单,只使用HTML标记。在ASP.NETMVC6中,您将看到这一点。