我的get ajax请求未从一个帖子请求的响应中调用。以下是代码
$("#buttonclick").on("click", function () {
var projectCollection = "DefaultCollection";
var project = $("#Configuration_iCodeProjectID").val();
var definitionId = $("#buildDefinition").val();
//if (validateTriggerNewBuild) {
$.ajax({
type: "POST",
url: "/Operations/TriggerBuild",
data: { "projectCollection": projectCollection, "project": project, "definitionId": definitionId },
datatype: "application/json",
success: function (data) {
var buildId = $("#hdnBuildDefinitionId");
buildId.text(data);
startGetProgress();
}
})
//}
});
function startGetProgress() {
window.progressID = setInterval(getProgress(), 10000); // update progress every 10 seconds
}
function getProgress() {
var buildId = $("#hdnBuildDefinitionId").text();
$.getJSON('GetBuildLogs', function (data) {
});
private JsonResult GetBuildLogs() {
//get the id for the currently running build
//connect to the tfs service to get the logs
//populate the textbox with the logs
return Json(string.Empty, JsonRequestBehavior.AllowGet);
}
}
根据按钮单击我试图在textarea中加载值,但我的方法没有被调用。我不确定这是否可行,或者我有更有效的方法。请提供宝贵的建议。
答案 0 :(得分:1)
将Action
方法access modifier
更改为公开