컨트롤러에 다음 ActionResult가 있습니다. 그것은 IDAjax에서 json 데이터를 표시하고 MVC3에서 JQuery Dialog를 표시합니다.보기
[HttpPost]
public ActionResult Get(Guid Id)
{
Ref imp = ReadRepository.GetById(refImpId);
var ijson = new JsonResult() { Data = imp.ToJson() };
return ijson;
}
에 따라 데이터베이스 (예 : ID, 이름, 도시 등 등) 데이터의 행 뒤에 오는 JQuery와 대화에 대한 JQuery와 아약스입니다 반환합니다.
$(".ImpList").click(function (e) {
// get the imp id
var refImpId = $(this).next('#impId').val();
var impgeturl = $('#impgeturl').val();
var imptoedit = null;
$.ajax({
type: 'post',
url: impgeturl,
data: '{ "refImpId": "' + refImpId + '" }',
contentType: "application/json; charset=utf-8",
traditional: true,
success: function (data) {
imptoedit = jQuery.parseJSON(data);
$("#editImpDialog").dialog({
width: 350,
height: 220,
modal: true,
draggable: false,
resizable: false,
});
},
error: function (request, status, error) {
alert(e); // TODO: need to discuss ajax error handling and form reset strategy.
}
});
});
$("#cancelEditImpBtn").click(function (e) {
e.preventDefault();
$('#editImpDialog').dialog("close");
});
$("#saveEditImpBtn").click(function (e) {
e.preventDefault();
$("form").submit();
});
나는 내보기에 대화 상자가 있습니다. Json Data를 Jquery 대화 상자에 표시해야합니다. 내가 어떻게 할 수 있니?
당신은 가져 오기 작업에 매개 변수를 사용하고 있지 않습니다. 귀하의 코드는 사실입니까? – rcdmk