【问题标题】:Problem calling WebMethod in asp.Net Webform在 asp.Net Webform 中调用 WebMethod 的问题
【发布时间】:2023-03-26 22:39:01
【问题描述】:

我在我的应用程序中调用了一个 WebMethod。最近我更改了根配置以升级多语言部分。

public static void RegisterRoutes(RouteCollection routes)
    {


         routes.MapPageRoute("languageHome","{language}/{page}","~/{page}.aspx");

    }

从那时起,我似乎无法使用 jQuery 调用 WebMethod

   function ShowNumeroLame() {
         $.ajax({
             type: "POST",
             url: "Home/GetNumeroLame",
             contentType: "application/json; charset=utf-8",
             dataType: "json",
             success: OnSuccessNumeroLame,
             error: function () {
             },
             failure: function (response) {
             }
         });
     }

我认为问题出在 URL 但我找不到它

谢谢,抱歉我的解释不好

【问题讨论】:

    标签: javascript webforms root multilingual webmethod


    【解决方案1】:

    我解决了这个问题:

    url: '<%=Page.ResolveClientUrl("Home.aspx/GetSpessoriFette") %>',             
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-11-12
      • 2012-09-21
      • 2013-10-05
      • 1970-01-01
      • 2013-10-07
      • 1970-01-01
      相关资源
      最近更新 更多