A day with .Net

My day to day experince in .net

Update Progress in MVC 4

Posted by vivekcek on May 27, 2013

The below code is used for showing a progress bar when an ajax link is clicked. The ‘LoadingElementId’ attribute of AjaxOptions can be used to specify a progress div.

<div id="timeDiv">
@Ajax.ActionLink("Click to get Server time", "GetServerTime", new AjaxOptions
{
    LoadingElementId = "Progress",
    HttpMethod = "GET",
    InsertionMode = InsertionMode.Replace,
    UpdateTargetId = "timeDiv"
})
</div>

<div id="Progress" style="display:none">
    <img src="../../Content/spinner.gif" alt="IMG" />
</div>
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s