I am very confuse with this partial view.
I want to load a partial view inside my main view.
Here is the simple example.
I am loading Index.cshtml of the Homecontroller Index action as a main page.
In index.cshtml, I am creating a link via
@Html.ActionLink("load partial view","Load","Home")
in HomeController I am adding a new Action called
public PartialViewResult Load()
{
return PartialView("_LoadView");
}
in _LoadView.cshmtl I am just having a
<div>
Welcome !!
</div>
BUT, when run the project, index.cshtml renders first and shows me the link "Load Partial View". when I click on that it goes to new page instade of rendering the welcome message from _LoadView.cshtml into the index.cshtml.
What can be wrong?
Note: I don't want to load page through AJAX or don't want to use Ajax.ActionLink .
See Question&Answers more detail:os