1
MVC 애플리케이션이 있습니다.컨트롤러에서 Jquery로 값 보내기
컨트롤러 :
public ActionResult DescargaCsv()
{
// do stuff
if (status != 0){
return value to javascript and display an alert there
}
else{
//do other stuff, this is OK
}
}
자바 스크립트 : 내가 컨트롤러에서 얻고있다 "상태"의 자바 스크립트 값을 보낼 수있는 방법
function fnDownloadExcel() {
$.ajax({
url: fnDownloadExcel?idArchivo=" + $("#idArchivo").val(),
type: "POST",
success: function (data) {
$("#idMessage").val(data[0]);
if (data[0] == "R") {
alert("Status: " + $("#idMensaje").val());
}
else {
//do other stuff
}
}
});
?