asp.net网站中的应用程序配置不允许使用URL

时间:2013-07-02 06:10:53

标签: asp.net web-services jquery url webmethod

问题是什么,对服务的调用工作正常,但是当它在线时显示Given URL is not allowed by the Application configuration应用程序的设置不允许使用一个或多个给定的URL。

它必须与网站URL或Canvas URL匹配,或者域必须是控制台日志中某个App域的子域?

代码:

 function CallService(serviceurl) {
         alert(serviceurl);
         $.ajax({
                 Type: "GET", 
                 contentType: "html",
                 url: serviceurl,
                 success: function (arg) {
                          console.log(arg);
                          if (arg != "") {
                          if (arg == "nodata") {
                          console.log(arg); 
                          chkData = false;
                          $('#loading').empty(); return; } 
                          $("#dynamiccontainer").append(arg);
                          chckGamesDisplayed = false; } $('#loading').empty();
                         } 
                      }
           );} 

1 个答案:

答案 0 :(得分:2)

早些时候我正在使用 var serviceurl = document.getElementById(' hfbasicurl')。value +" /Pages/abc.aspx?Id =" + id;

使用下面的代码,现在正常工作

var serviceurl = "Pages/abc.aspx?Id=" + id;