Asp.net에서 페이지의 부분 업데이트를하려고합니다. 아약스를 통해 .aspx 페이지를 호출하여 내 페이지의 특정 지점에 추가해야하는 콘텐츠를 작성했습니다. 이전에는 이것이 저에게 효과적이었습니다.Ajax 공급자가 너무 많은 HTML을 반환합니다. Asp.Net
현재 문제는 요소 대신 전체 HTML을 얻었 기 때문에 이전에 내가 한 일을 파악할 수 없다는 것입니다.
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);
}
}
});
newDiv = $ (결과) .contents() ('#의 DupPpl')를 찾을 수 html로()를보십시오; 문제가 newDiv의 내용 인 경우 – RedDevil79
문제는 실제로 결과가 – KennO
인 정상이며 결과는 항상 해당 페이지가 브라우저로 반환하는 결과가됩니다. – RedDevil79