function BindNewsTypeTree() {
var parentid;
// $.getJSON(serviceUrl + "NewsTypeService.svc/GetNewsTypeTreeJson?jsoncallback=?",
$.getJSON(serviceUrl + "NewsTypeService.aspx?jsoncallback=?",
{ siteID: siteID, isNewsType: true, fun: 'GetNewsTypeTreeJson' },
function (data) {
// alert(data);
$('#treeNews').tree('loadData', $.parseJSON(data));
SetSelectedNode();
});


});
}

 

if (!IsPostBack)
{
System.Collections.Specialized.NameValueCollection querylist = Request.QueryString;
if (querylist == null)
{
Response.End();
}
else
{
string fun = querylist["fun"];
string result = "";
if (fun == "GetNewsTypeTreeJson")
{
result = ToJSON(GetNewsTypeTreeJson(C_int32(DG_keyVale(querylist, "siteID")), C_bool(querylist["isNewsType"])));
}
else if (fun == "GetPageEntityList") {

result = ToJSON(GetPageEntityList(C_int32(DG_keyVale(querylist, "siteID")), C_int32(DG_keyVale(querylist, "parentID")), C_int32(DG_keyVale(querylist, "pageIndex")), querylist["name"]));
}
else if (fun == "DeleteData") {
result = ToJSON(DeleteData(C_int32(DG_keyVale(querylist, "siteID")), C_int32(DG_keyVale(querylist, "id"))));
}

Response.Clear();
Response.ContentEncoding = System.Text.Encoding.UTF8;
Response.ContentType = "application/json";
if (!string.IsNullOrEmpty(result))
{
if (querylist["jsoncallback"] != "")
{
JavaScriptSerializer jss = new JavaScriptSerializer();

Response.Write((querylist["jsoncallback"] + "(" + jss.Serialize(result) + ");"));//+ "\""这里要注意的
}
else
{
Response.Write(result);
}
}

Response.Flush();
Response.End();
}
}

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-24
  • 2021-06-15
  • 2021-11-16
  • 2021-11-14
  • 2021-07-17
  • 2021-12-15
猜你喜欢
  • 2022-12-23
  • 2021-11-22
  • 2022-01-18
  • 2021-09-23
  • 2022-02-24
  • 2022-01-17
  • 2021-06-28
相关资源
相似解决方案