2013-04-17 42 views
-1

我有一个视图(FilerOverall)和视图内我使用renderaction方法调用一些方法。使用ActionResult获取错误

@{ 
Html.RenderAction("Gettemplate", "FinancialDisclosure", 
    new { FormId = "100",ScheduleId= "10" }); 
}; 

,并在控制器我已经写的

public ActionResult Gettemplate(string FormId ,string ScheduleId) 
{ 
    List<FDDTO> FD1 = FDService.GetScheduleDetails(100, 10).ToList(); 
    return View ("EditorTemplates/FDDTO", FD1); 
} 

当我执行我得到这个错误的程序操作方法:

"A public action method 'Gettemplate' was not found on controller 'WorldBank.DOI.Presentation.Controllers.FinancialDisclosureController'."}

回答

0

尝试@Html.Action代替Html.RenderAction

@Html.Action("Gettemplate", "FinancialDisclosure", new { FormId = "100",ScheduleId= "10" }) 
+0

谢谢你你的时间,我实际上使用editorfor和我的问题得到解决。 – user2181707

0

你应该试试这个

创建新的视图Demo.cshtml

现在

public ActionResult Gettemplate(string FormId ,string ScheduleId) 
{ 
    List<FDDTO> FD1 = FDService.GetScheduleDetails(100, 10).ToList(); 
    return View ("Demo", FD1); 
} 

现在把你的FilerOverall.cshtml下面的代码

@{ 
Html.RenderAction("Gettemplate", "FinancialDisclosure", 
    new { FormId = "100",ScheduleId= "10" }); 
};