Asp.net mvc 4 使用[AcceptVerbs(HttpVerbs.Post)]时,ActionResult未命中

Asp.net mvc 4 使用[AcceptVerbs(HttpVerbs.Post)]时,ActionResult未命中,asp.net-mvc-4,razor,view,controller,Asp.net Mvc 4,Razor,View,Controller,当我在操作结果中使用[AcceptVerbShttperbs.Post]时,它显示了错误 HTTP 404。您正在查找的资源或其依赖项可能已被删除、名称已更改或暂时不可用。请检查以下URL并确保其拼写正确 当我删除[AcceptVerbShttperbs.Post]时,它可以正常工作。 为什么会这样?这段代码是 [AcceptVerbs( HttpVerbs.Post )]//will do action when we use Html.BeginForm() public ActionRes

当我在操作结果中使用[AcceptVerbShttperbs.Post]时,它显示了错误

HTTP 404。您正在查找的资源或其依赖项可能已被删除、名称已更改或暂时不可用。请检查以下URL并确保其拼写正确

当我删除[AcceptVerbShttperbs.Post]时,它可以正常工作。 为什么会这样?这段代码是

[AcceptVerbs( HttpVerbs.Post )]//will do action when we use Html.BeginForm()
public ActionResult GenerateReport( FormCollection fromCollection )//FormCollection:It provides to access  the values that were just posted to your page. 
{
    ReportInfo reportInfo = new ReportInfo();
    reportInfo.PatientId = "1111";
    reportInfo.PatientName = fromCollection.Get("patientName");
    reportInfo.PatientSex = "female";
    reportInfo.Findings=fromCollection.Get("Findings");
    reportInfo.History = fromCollection.Get("History"); 
    FillImageUrl( reportInfo, "PatientData.png" );
    return this.ViewPdf( "Radiology Report", "Index", reportInfo );

}

您能否建议解决此错误的解决方案

请尝试[HttpPost],而不是syntaxMay Form正在查找Get方法,因为Get-method属性未定义。因此,当您删除[AcceptVerbsHttpVerbs.Post]属性时,它就起作用了。您能给我们展示一下您的视图/表单吗。我认为你在表格中写得很糟糕。