【问题标题】:Does authentication/authorization stop Jquery from calling a page method?身份验证/授权是否会阻止 Jquery 调用页面方法?
【发布时间】:2008-11-07 16:00:09
【问题描述】:

我有以下在 C#/Asp.net 2.0 中完美运行的 JQuery 代码,可以在 default.aspx 页面中调用页面方法。现在我试图在 VB.Net 中调用一个共享页面方法并且页面方法没有触发,我相信是因为安全或者它没有找到它。

这个共享 vb 方法所在的页面不允许匿名访问,所以我认为这是问题所在,或者是查找该方法的路径问题。我只是在这里猜测。在我的 C# 测试应用程序中,静态 webmethod 位于 default.aspx 页面中,没有安全性。感谢您的任何建议或帮助!

$.ajax({
                type: "POST",
                url: "Orders.aspx/GetMailPieceGroupsByAdFundTypeId",
                data: myDataToSend,
                contentType: "application/json; charset=utf-8",
                dataType: "json", 
                //error: function(XMLHttpRequest, textStatus, errorThrown) {alert(errorThrown); this;},
                success: function(data, textStatus){alert(success);mailPieceGroups = eval('(' + data + ')'); startSlideShow(mailPieceGroups); }
            });

【问题讨论】:

    标签: asp.net jquery vb.net


    【解决方案1】:

    我的问题是提供的路径不正确,导致 .ajax 调用无法找到调用它的方法。 这对我的场景是正确的:

    网址:“../Orders.aspx/GetMailPieceGroupsByAdFundTypeId”,

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-09-27
      • 2017-05-28
      • 1970-01-01
      • 1970-01-01
      • 2021-02-22
      • 1970-01-01
      相关资源
      最近更新 更多