ASP.NET 4 jquery ajax webmethod call

前端 未结 1 1821

In ASP.NET 3.5 I had this javascript on a page (default.aspx):

function getMoreNewsItems() {
    $.ajax({
        type: \"POST\",
        url: \"default.aspx         


        
相关标签:
1条回答
  • 2021-01-07 11:32

    Fixed,

    Change

    url: "default.aspx/LoadNewsItems",
    

    To

    url: '<%= ResolveUrl("default.aspx/LoadNewsItems") %>',
    

    It has to do with the URL Routing.

    0 讨论(0)
提交回复
热议问题