problem description
I want to write AJAX, on the page and pass the value in an input to the action, in controller and take out the call. Please give me some advice
.the environmental background of the problems and what methods you have tried
related codes
/ / Please paste the code text below (do not replace the code with pictures)
$(function () {
$.ajax({
type: "post",
url: "/CustomsInspections/GetData",
dataType: "json",
//contentType: "application/json",
data: {
operation_id: $("-sharpOperation_ID").val(),
fight_no: $("-sharpFlight_NO").val(),
mbl: $("-sharpMBL").val(),
consign_code_ck: $("-sharpConsign_Code_CK").val(),
},
success: function (data) {
if (data == "success") {
console.log("");
}
else {
console.log("");
}
}
});
})
public ActionResult GetData (string operation_id,int page = 1, int rows = 10, string sort = "Id", string order = "asc", string filterRules = "")
{
var filters = JsonConvert.DeserializeObject<IEnumerable<filterRule>>(filterRules)??new List<filterRule>();
var ArrFilter = new List<filterRule>();
string fight_no = Request["fight_no"].ToString();
string mbl = Request.Form["mbl"].ToString();
string consign_code_ck = Request.Params["consign_code_ck"].ToString();
what result do you expect? What is the error message actually seen?
I think it"s written on the Internet, but all the fight_no,mbl,consign_code_ck fetched are null
.