2010-08-26 55 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服務類的工作?如果不這樣做會導致一個例外 - 但我不確定是否會得到你所得到的。

相關問題