404 error when using server side

404 error when using server side

magmomagmo Posts: 6Questions: 3Answers: 0

Hi

I use the datatable like this ..

  ajax: {
    type: "POST",
    contentType: "application/json; charset=utf-8",
    url: "/TableData.aspx/Data",

in order to use server side data, the page run fine in debug mode in visual studio. But when I run it in IIS I get a 404 error on "TableData.aspx/Data" causing the error /tn/7 to appear. The "Data" in TableData.aspx/Data is a webmethod that return the Json for the datatable, how can this be fixed?

Answers

  • allanallan Posts: 61,920Questions: 1Answers: 10,153 Site admin

    All I can really say is that if you are getting a 404 then the is nothing on the server that accepts a POST to that URL. Possibly a routing issue on the server?

    Allan

  • magmomagmo Posts: 6Questions: 3Answers: 0

    Thanks it was as simple as removing a forward slash like this..

    ajax: {
    type: "POST",
    contentType: "application/json; charset=utf-8",
    url: "TableData.aspx/Data",

  • allanallan Posts: 61,920Questions: 1Answers: 10,153 Site admin

    Hah - one character fixes are always the best :-).

    Thanks for posting back!

    Allan

This discussion has been closed.