I have a Refresh button on my page that will perform an asp.net mvc ajax post to update some of the content on the page. The refresh/update process can be long running (about 10-20 seconds). Right now the user has to manually click the Refresh button to trigger the refresh. I want to trigger the refresh automatically every X minutes. Pretty much I want to trigger this same Ajax post as below (and it would be nice to display the LoadingElementId too).
<% using (Ajax.BeginForm("Refresh", null,
new {userId=Model.UserId},
new AjaxOptions { UpdateTargetId = "UserForm", LoadingElementId = "RefreshingDiv" },
null))
{
%>
<button type="submit">
<img src="/zsys/img/icons/refresh.png" alt="Refresh" />
Refresh
</button>
<% } %>
How can I force the asp.net mvc ajax postback?