I have a jquery function in my View(Index.cshtml)...
<script type="text/javascript">
// call ASP.NET MVC Controller and return value of Checkboxes as string array
function SerializeMappings()
{
var matches = [];
$('[class^="mappings_"]:checked').each(function () {
matches.push(this.value);
});
$.post("/Home/Validate", { listofmappings: matches }, function (data) {
document.write(data);
});
}
</script>
This function calls this function:
// POST: Home/Validate
[HttpPost]
public ActionResult Validate(string[] listOfMappings)
{
//Some code which takes Long time (~10-15sec)
//....
//fill List<List<string>> with data and return it to Validate.cshtml
return View(anyStringList);
}
Now my real question: How can I display a loading circle while the 'Validate' function is running...? Thanks in advance.
ajaxStartandajaxStopfunction to do that.