[Index.cshtml(main view)]
<div id="main">
<button onclick="clickme()">Navigate To Gantt</button>
</div>
<script type="text/javascript">
//Triggered on drop down change action
function clickme() {
//ajax call to server side method to refresh partialView
$.ajax({
//serverside method name and controller name
url: '@Url.Action("_Gantt", "Gantt")',
success: function (data) {
$("#main").html(data);
}
});
}
</script>
[Gantt.cshtml(partial view)]
@(Html.EJ().Gantt("GanttContainer")
.TaskNameMapping("TaskName")
)
@(Html.EJ().ScriptManager())
[controller]
public class BusinessObject
{
public string TaskName{get; set;}
//
}
[HttpGet]
public ActionResult _Gantt()
{
var DataSource = this.GetPlanDataSource();
ViewBag.datasource = DataSource;
return PartialView("Gantt", DataSource);
} |