0
我正在特林從一個ASHX handller我的js代碼獲取JSON對象如下通過JSON值通過ashx的處理程序:asp.net:
<script type="text/javascript">
var path = 'Handler.ashx';
$.ajax({
url: path,
dataType: 'json',
}).success(function (data) {
$('#content').html(JSON.stringify(data.a))
});
</script>
和代碼handller
using System;
using System.Data;
using System.Web;
using System.Linq;
using System.Collections;
using Newtonsoft.Json;
public class Handler : IHttpHandler {
public string ProcessRequest (HttpContext context) {
string a = "hello world";
return JsonConvert.SerializeObject(a);
}
public bool IsReusable {
get {
return false;
}
}
我無法從下面的代碼中獲取任何輸出plz正確的代碼ü