NET WEB API和我搜索过以JSON格式获取数据的表单,实际上是我在同一页面中显示的响应数据。
我想将此数据发送到另一个带有ajax的页面,如果可能的话,并在那里显示结果。 这是AJAX代码:
function AJAX_search_Profile(data) {
//alert('Ajax1');
if (!false)
//alert('Ajax2');
ajaxRequest = $.ajax({
type: "POST",
url: "../../api/Controllers/Manage_Search/search_Profile_by_Many_criterion",
contentType: false,
processData: false,
data: data
});
ajaxRequest.done(function (responseData, textStatus) {
AJAX_CallBack_search_Profile_by_Name(responseData, textStatus);
});
}
//Callback method
function AJAX_CallBack_search_Profile_by_Name(responseData, textStatus) {
if (textStatus == 'success') {
if (responseData != null) {
if (responseData.Key) {
// alert(responseData.Value);
var JsonData = jQuery.parseJSON(responseData.Value);
fill_in_Data(JsonData.docs);
//window.location.replace("./Home/Members");
// with this methode i print search result in the same
//page ,what i would is to redirect to another page and send this data with it
//in ajax
} else {
alert(responseData.Value);
}
}
} else {
alert(responseData.Value);
}
}