Partial view from other controller

  1. You can share views between controllers by putting them into the Views/Shared folder. Each controller can then render that view by name.
  2. You can render a partial view (which can be shared between controllers as in (1)) within the current view using Html.Partial().
  3. You can use Html.Action() to invoke an action on a different controller and render the results within the current view.
  4. You can use AJAX to load a partial view from a different controller after the page has been rendered.
  5. return PartialView("/path/view.cshtml"); Alternatively you can put the partial view in views/shared then just return PartialView("view.cshtml"

Refer to http://stackoverflow.com/questions/7968234/render-partial-view-from-other-controller

 

posted @ 2012-09-28 10:53  webglcn  阅读(309)  评论(0编辑  收藏  举报