Calling another different view from the controller using ASP.NET MVC 4

后端 未结 5 1747
夕颜
夕颜 2020-12-05 03:58

I have a view (Index.cshtml) with a submit button. When the submit button is clicked, it calls an action (Action01) within the controller (TestController.cs) so at the end o

5条回答
  •  执笔经年
    2020-12-05 04:35

    You can directly return a different view like:

    return View("NameOfView", Model);
    

    Or you can make a partial view and can return like:

    return PartialView("PartialViewName", Model);
    

提交回复
热议问题