You can also use @Ajax.ActionLink without the need for a jQuery script. For example, you can show the div when the page loads.
<div> @Ajax.ActionLink("Link name", "Action", "Controller", new AjaxOptions { LoadingElementId = "loadingId", UpdateTargetId = "MyDataTable" }) </div> <div id="loadingId" style="display:none; color:Red; font-weight: bold"> <p>Please wait...</p> </div> <div id = "MyData" class="tablediv"> <table id = "MyDataTable" class="Grid"> <tbody id="chartdata"> </tbody> </table> </div>
source share