Home > Net >  NopCommerce development jquery post always fail
NopCommerce development jquery post always fail

Time:10-10

Use nopCommerce based on.net core2.2 do secondary development study found in the new background of the view after the post can't succeed, but it can Get inspection for a long time and I don't know what wrong with know a 400 error and error of jquery XHR. Send (options. HasContent & amp; & Options. Data | | null); Error please help have a look at the great god,,,
But get can get the data

Thank you all for the first
As shown in figure

CodePudding user response:

refer to the original poster my ass I face response:
use nopCommerce is based on. Net core2.2 do secondary development of the study found that the new view of the background after the post can't succeed, but it can Get inspection for a long time and I don't know what wrong with know a 400 error and error of jquery XHR. Send (options. HasContent & amp; & Options. Data | | null); Error please help have a look at the great god,,,
But get can get the data

Thank you all for the first
As shown in figure

Forget to stick the ajax code

The $(document). Ready (function () {
$(' # inputcode). Bind (' click ', function () {
Var postData=({https://bbs.csdn.net/topics/JSON.stringify
"Id" : "1"
});
$. Ajax ({
DataType: "json",
Cache: false,
Type: "Post",
Url: "@ url. The Action (" GetDataFromHTML") ",
contentType: "application/json; Charset=utf-8,
"Data: postData,
Success: the function (data) {
alert(data);
},
Error: function (data) {
Alert (" kneel, ");
},
Complete: the function () {
}
});
return false;
});
});

CodePudding user response:

God help me,,
  •  Tags:  
  • C #
  • Related