zoukankan      html  css  js  c++  java
  • wcf json asp.net json

    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();
    }
    }

  • 相关阅读:
    python基础一
    IO多路复用
    协程
    线程之互斥锁与递归锁、队列、线程池
    线程
    进程之间的通信与数据共享
    进程
    操作系统的简介
    PyCharm的基本使用指南
    【解决方案】明明安装了库,PyCharm还是提示:No module named bs4 / No module named 'requests'
  • 原文地址:https://www.cnblogs.com/window5549-accp/p/3584876.html
Copyright © 2011-2022 走看看