I have a div in MVC view which has a webgrid binded to a model. On initial page load the gird is perfectly populated by Model data but when I click the button on the same page the grid should be be updated by search values which is not happening. The grid is having same initial data even after button click. How should I refresh grid with updated values?
@{ var gd=new WebGrid(Model.NonPromoJobList,canPage:true,rowsPerPage:5,canSort:true, selectionFieldName:"selectedRow",ajaxUpdateContainerId:"gridContent");
gd.Pager(WebGridPagerModes.NextPrevious);
}
<div id="gridContent" class="container-fluid">
@gd.GetHtml(
columns: gd.Columns(
gd.Column("JobTitle", "Job Title",format:
@<text><a href="javascript:void()" onclick="javascript:showJobNotice('@item.JASEQ');" title="Job Title"> @Html.Raw(item.JOBTITLE) </a> </text>),
gd.Column("Department","Department"),
gd.Column("Location","Location"),
gd.Column("ClosingDate","Closing Date"),
gd.Column("Action",style:"col1",format: @<text>
<a class="btn btn-xs btn-info" title="Apply Online" onclick="javascript:openApp('@item.JOBTITLESEQ');" href="javascript:void()">Apply</a>
</text>
)))
</div>
<div class="panel-footer text-center color4 ">
<input type="button" class="btn btn-primary btn-s" value="Search" onclick="searchJobs()" />
</div>