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
$('#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()
{
}
Rajkiran SwainPosted Jun 24, 2023, 2:34 AM