前台:
程式碼如下:
$ {
type: "POST",
url: "GetMenuRole.ashx",
data: "",
dataType: "json",
success: function (data) {
if (data.Status == false) {
alert(data.ErrorReason);
}
else {
//解析這個選單清單
alert(data.MenuList);
}
},
error: function (data) {
alert(data);
}
});
複製程式碼
程式碼如下: 程式碼如下: string = sReturnJson "
"Status":"{0}","MenuList":"{1}","ErrorReason":"{2}""; sReturnJson = string.Format(sReturnJson, "True", sReturnMenuList,string.Empty).Replace("
","{").Replace("","}"); context.Response.Write(sReturnJson);