I am trying to make a partial update of a page in Asp.net. I call my .aspx page through ajax to build the content i need to append into a specific spot on my page and previously this has worked for me.
My current problem is that I get the full html instead of just the element and I can't figure out what I did right previously.
var dataObj = { 'includeInactive': includeInactive, 'MasterPersonId': masterId, 'sChosenSSN': chosenSSN };
$.ajax({
url: 'clientside/providers/MergeJournalProviders/---ShowSomeDuplicateCivilRegistrationNumbers.aspx',
dataType: 'html',
data: dataObj,
cache: false,
async: true,
beforeSend: function (xhr) {
},
success: function (result) {
if (result != "" && result != undefined) {
//var htmlToAppend = $(result).find("#DuplicatePeople div").html();
//her vælger jeg gruppen(group) der skal opdateres
var oldDiv = $('#DupPpl');
var newDiv = jQuery(result).find('#DupPpl').html()
oldDiv.replaceWith(newDiv);
//$('#DupPpl').empty();
//$('#DupPpl').html(jQuery(result).find('#DuplicatePeople').html());
//$('#DupPpl').remove();
//$('#DupPpl').append(result);
//$('#DupPpl').append(result);
}
}
});