Edit
I mistakenly thought the question was about the AJAX assistant. Here you can do it with HtmlHelper.
First add the id to the form so that you can capture it using jQuery:
@using (Html.BeginForm("SData", "Crawl", FormMethod.Post, new { id = "myform" })) {
Then add a Javascript event handler to intercept the form submission and display the loaded GIF.
$("#myform").submit(function(e) { $("#myLoadingElement").show(); });
(The original answer follows ...)
Use the AjaxOptions class to set the LoadingElementId , and the Ajax helper will display this element, awaiting a response from the server:
@using (Html.BeginForm("SData","Crawl", new AjaxOptions() { LoadingElementId="myLoadingElement" })) {
Then just put your gif wherever you want to display it (hide it first):
<div id="myLoadingElement" style="display: none;"> <img src="loading.gif" alt="Loading..." /> </div>
Mcgarnagle
source share