If you want to load a partial view directly in the main view, you can use the Html.Action :
@Html.Action("Load", "Home")
or if you do not want to pass the “Download” action, use the HtmlPartial hepler:
@Html.Partial("_LoadView")
If you want to use Ajax.ActionLink , replace Html.ActionLink with:
@Ajax.ActionLink( "load partial view", "Load", "Home", new AjaxOptions { UpdateTargetId = "result" } )
and, of course, you need to enable the holder on your page, where the partial will be displayed:
<div id="result"></div>
Also remember to include:
<script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.js")" type="text/javascript"></script>
in the main window to enable Ajax.* . And make sure that unobtrusive javascript is included in your web.config (it should be the default):
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
Darin Dimitrov Sep 03 2018-11-21T00: 00Z
source share