-1

After debugging my application, I found that ajax call is unsuccessful. I have tried multiple solutions found on web but still I am unable to resolve this issue. One solution which I found is to set

settings.AutoRedirectMode = RedirectMode.Off;  

line in RouteConfig.cs but my RouteConfig.cs file does not contain this. This is the code in RouteConfig.cs file.

Routeconfig.cs

I also tried this but still it made no difference

url: '<%= ResolveUrl("UploadProduct.aspx/SaveData") %>',

Code of Ajax call.

Ajax function

This is the Web method

enter image description here

James Z
  • 12,209
  • 10
  • 24
  • 44
  • what is the result ? http code ? 404 ? 500 ? Did you tried to call the method with Postman ? – Zysce Aug 21 '18 at 18:36
  • To debug an Ajax call, it is recommended to use the `Network` tab in Google Chrome. It shows how the Ajax call is formed with all the parameters, and the response from the server. – Alfred Wallace Aug 21 '18 at 18:44
  • 4
    Please don't post code as images. Copy your actual code into the question and format it as code. – James Z Aug 21 '18 at 19:40

1 Answers1

0
$.ajax({

       url: "/Controller/ActionMethod/",
      method: "POST",
      data: {empdata: data}
     });
Charan
  • 29
  • 1
  • 6
  • While this code may answer the question, it is better to explain how to solve the problem and provide the code as an example or reference. Code-only answers can be confusing and lack context. – Robert Columbia Aug 21 '18 at 22:25