【问题标题】:Given URL is not allowed by the Application configuration in asp.net websiteasp.net 网站中的应用程序配置不允许给定 URL
【发布时间】:2013-06-29 09:43:48
【问题描述】:

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

它必须与网站 URL 或画布 URL 匹配,或者该域必须是控制台日志中应用程序域之一的子域?

代码:

 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();
                         } 
                      }
           );} 

【问题讨论】:

  • 你能给我们一些源代码吗?
  • 我得到了正确的服务 url,但没有成功调用服务,但在本地它工作正常
  • 你能提供你的本地和在线网址吗
  • 如果 url 被单独称为它的显示数据,但它在使用 ajax 调用时显示错误
  • serviceurl 中的内容

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


【解决方案1】:

之前我在使用 var serviceurl = document.getElementById('hfbasicurl').value + "/Pages/abc.aspx?Id=" + id;

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

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

【讨论】:

    猜你喜欢
    • 2013-01-06
    • 2016-01-06
    • 1970-01-01
    • 2014-04-26
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多