使用[AcceptVerbs(HttpVerbs.Post)]时ActionResult没有击中

时间:2013-10-25 06:13:40

标签: asp.net-mvc-4 razor view controller

当我使用[AcceptVerbs(HttpVerbs.Post)]作为我的操作结果时,它会显示错误

HTTP 404.您要查找的资源(或其中一个依赖项)可能已被删除,名称已更改或暂时不可用。请查看以下网址,确保拼写正确。

当我删除[AcceptVerbs(HttpVerbs.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 );

}

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

0 个答案:

没有答案