AJAX with jQuery이 작업을 수행하는 좋은 방법입니다. 는 DOM이로드되면 다음
<div id="result" data-remote-url="@Url.Action("Load", "SomeController")"></div>
과 : 그래서 예를 들어, 당신은 당신의 마크 업에 내용 자리의 사업부를 넣을 수있는로드 컨트롤러 액션이 원격 서비스와 통신 처리됩니다
$(function() {
$.ajax({
url: $('#result').data('remote-url'),
type: 'POST',
beforeSend: function() {
// TODO: you could show an AJAX loading spinner
// to indicate to the user that there is an ongoing
// operation so that he doesn't run out of patience
},
complete: function() {
// this will be executed no matter whether the AJAX request
// succeeds or fails => you could hide the spinner here
},
success: function(result) {
// In case of success update the corresponding div with
// the results returned by the controller action
$('#result').html(result);
},
error: function() {
// something went wrong => inform the user
// in the gentler possible manner and remember
// that he spent some of his precious time waiting
// for those results
}
});
});
데이터가 포함 된 부분도 반환 : 이제
public ActionResult Load()
{
var model = ... go ahead and fetch the model from the remote service
return PartialView(model);
}
를 데이터의 당신이 광고를 취할 수 I/O를 많이 가져 오는이 경우 원격 소스에서 데이터를 가져 오는 오랜 시간 동안 작업자 쓰레드가 위험 해지는 것을 피할 수있는 I/O 완료 포트 asynchronous controllers.
당신이 찾고있는 용어는 AJAX입니다. –