I work on razor asp.net . i face strange issue when apply ajax request it catch OnGet function get method
but correct or what I expect is to hit or catch OnGetshiftDataUp
why it catch on get and not catch OnGetshiftDataUp
when apply jquery ajax request it not catch OnGetshiftDataUp and catch OnGet why that happen
i write on url url: 'ShelfLabelPrinterSetUp?handler=shiftDataUp' so why it go to OnGet
full code sample
TypeScript
$('#save-btn').click(function () {
var param1Value = $('#editshelflabelModal #edit-ip').val();
console.log(param1Value);
$.ajax({
url: 'ShelfLabelPrinterSetUp?handler=shiftDataUp',
type: "GET",
dataType: "json",
data: { serverip: param1Value },
success: function (result) {
alert(result);
},
error: function (xhr, status, error) {
console.log(error);
}
});
});
public ActionResult OnGetshiftDataUp(string serverip)
{
return new JsonResult("Success");
}
public void OnGet()
{
}
Hi,@TempData["UserID"]
×
Server IP
Printer Name
Location Name
Close
Save changes
Rajkiran SwainRank #165 · 14.4K reputationPosted Jun 23, 2023, 10:34 PM EDT
$.ajax({ url: 'ShelfLabelPrinterSetUp/shiftDataUp', type: "GET", dataType: "json", data: { serverip: param1Value }, success: function (result) { alert(result); }, error: function (xhr, status, error) { console.log(error); } });