You can't do this on the server. The server does only send one response, and that's returned as soon as everything is rendered. If you really want to do it async (could you eventually cache this action?), you will have to do it with AJAX.
You can get it's content with jQuery (or something similar) with $.get or $.ajax (or similar).
So for example:
$.get('/umbraco/surface/YourSurface/YourAction', function (html)
{
// insert your html into the DOM
$('.partialContents').html(html);
});
Best Way To Render Action Asynchronously
Hi All,
I have an action in my surface controller that is time consuming, once the data is queried the results are returned in a partial view.
How can I load this into the template page asynchronously.
Thanks L
You can't do this on the server. The server does only send one response, and that's returned as soon as everything is rendered. If you really want to do it async (could you eventually cache this action?), you will have to do it with AJAX.
You can get it's content with jQuery (or something similar) with $.get or $.ajax (or similar).
So for example:
is working on a reply...