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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.