将模型传递给ASP.Net MVC 4中具有视图名称的视图

时间:2013-11-26 07:40:09

标签: asp.net-mvc-4

在我的ASP.Net MVC 4应用程序中,我想将模型发送到特定视图。这是伪代码 -

    public ActionResult Index()
    {
        A_Model model=new A_Model();
        return View(model, "ViewName");
    }

有什么办法吗?

谢谢。

1 个答案:

答案 0 :(得分:4)

使用

return View("ViewName", model);
相关问题