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.

2

1 Answer 1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.