user1688346
user1688346

Reputation: 1970

Load a div on Ajax call

I am using ASP.NET MVC telerik control to post an AJAX call to reload a page. But i only want to partially load a div within a page. How can i do that?

$('#AddInventory').ajaxForm({
beforeSubmit: function () {

    showWaitSlider("Please wait while uploading files. This may take a few moments.");
    return true;
},
success: function (data) {
    hideWaitSlider();
    location.reload();


},
error: function (xhr, status, err) {
    hideWaitSlider();
    alert(xhr.responseText);
},
dataType: 'json'

});

Upvotes: 1

Views: 442

Answers (1)

Explosion Pills
Explosion Pills

Reputation: 191819

data in the success function should return the response HTML, which you can parse to get your div.

//location.reload();
$("#MyDiv").html($("#MyDiv", data).html);

Upvotes: 3

Related Questions