1

The directory structure is:

controllers -> HomeController, TableController                            
views -> home -> index.cshtml                                  
views -> Table -> Navigate.cshtml

The index.cshtml corresponds to the index method in the HomeController the navigate.cshtml is a partial view and corresponds to the Navigate method in the TableController. The navigate method's return type is PartialViewResult and returns:

PartialView("Navigate", Data);

The Index.cshtml has @Html.RenderPartial()...

if I wanted to call the partial view from the TableController, could I just say:

@Html.RenderPartial("~/Controllers/Table/Navigate");

So it renders the partial view returned by navigate method in the TableController.

MikeSmithDev
  • 15,731
  • 4
  • 58
  • 89
user2405469
  • 1,953
  • 2
  • 22
  • 43

1 Answers1

3

IF all you want to do is to include the partial view. Why not call it using action method. Like:

@Html.Action("Navigate","Table")

You can place this anywhere and it should work.

Ashish Charan
  • 2,347
  • 4
  • 21
  • 33