在asp.Net Webform中调用WebMethod的问题。

问题描述 投票:1回答:1

我在我的应用程序中调用了一个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个回答
0
投票

我添加了这个,解决了这个问题。

url: '<%=Page.ResolveClientUrl("Home.aspx/GetSpessoriFette") %>',             
© www.soinside.com 2019 - 2024. All rights reserved.