I have the following code:
$.ajax({
type: "GET",
url: "/Search/GetNewData" //Controller/ActionMethod
---snip---
)};
This works fine when run via localhost, however when it is deployed, it cannot find the controller method. I think it’s probably a routing problem? But, with only a small limited knowledge using ASP.net, I would appreciate some advice.
Thanks.
The following snippet would work for both virtual directories and web sites.
You can also define the
baseUrivariable in your layout (above all<scripttags) to be able to use it in all included javascripts.