2010-08-26 120 views
1

“嗨 我打电话从JavaScript/jQuery的web服务如下:在mscorlib.dll中发生类型'System.UnauthorizedAccessException'的第一次机会异常?

function Test(userid) { 
    alert(userid); 
    $.ajax({ 
     type: "POST", 
     url: "testWebService.asmx/GetData", 
     data: "{ userid:'" + userid + "'}", 
     contentType: "application/json; charset=utf-8", 
     dataType: "json", 
     success: function (response) { 
     alert("1") 
     var dATAS = (typeof (response.d)) == 'string' ? eval('(' + response.d + ')') : response.d; 
     alert("2")       

     }, 
     failure: function (msg) { 
     } 
    }); 
} 

的用户ID得到警告,

web服务进行测试,它工作时,其他警报犯规表演。

输出显示了这个:

型“System.UnauthorizedAccessException的”的第一次机会异常出现在mscorlib.dll

我是怎么有错?

编辑:我复制的功能,解决方案中的另一个现有的web服务,它没有问题

回答

0

你曾经通过ScriptService属性标记您的Web服务类的工作?如果不这样做会导致一个例外 - 但我不确定是否会得到你所得到的。

相关问题