umki
umki

Reputation: 779

Calling Ajax.ActionLink after page load completed

I have Ajax.ActionLink which returns partialview in my dahsboard view as below :

@Ajax.ActionLink("2013", "chartAjax", "Dashboard", new { yearForChart = "2013"  }, new AjaxOptions { UpdateTargetId = "chartAjax", HttpMethod = "GET"})

But it is calculating the financial data and counts of data. So it is taking too time to load. I want to call this Ajax.ActionLink, after the Dashboard load has been completed. And i can show a loading bar while the partialview is loading ?

Thanks.

Upvotes: 0

Views: 705

Answers (1)

Jonesopolis
Jonesopolis

Reputation: 25370

i'd just use jquery, something like

<script>
   $(document).ready(function() {
       $.ajax({
             type:"GET",
             url: "/Dashboard/chartAjax/2013"
           }).success(function(responseData){
                 $('#chartAjax').html(responseData);
           }
        };
   });  
</script>

Upvotes: 1

Related Questions