/// <summary>///參考: http://james.newtonking.com/json/help/index.html#/// 塗聚文(Geovin Du) 20141228/// 捷為工作室/// </summary>public partial class _Default : System.Web.UI.Page{Geovindu_TimeLineProjectInfo geovindu_TimeLineProjectInfo = new Geovindu_TimeLineProjectInfo();Geovindu_TimeLineProjectBLL geovindu_TimeLineProjectBLL = new Geovindu_TimeLineProjectBLL();Geovindu_TimeLineAssetInfo geovindu_TimeLineAssetProjectInfo = new Geovindu_TimeLineAssetInfo();List<Geovindu_TimeLineDataInfo> selectGeovindu_TimeLineDataProject = new List<Geovindu_TimeLineDataInfo>();Geovindu_TimeLineDataInfo geovindu_TimeLineDataInfo = new Geovindu_TimeLineDataInfo();Geovindu_TimeLineAssetInfo geovindu_TimeLineAssetDataInfo = new Geovindu_TimeLineAssetInfo();Geovindu_TimeLineAssetBLL geovindu_TimeLineAssetBLL = new Geovindu_TimeLineAssetBLL();Geovindu_TimeLineDataBLL geovindu_TimeLineDataBLL = new Geovindu_TimeLineDataBLL();/// <summary>/// /// </summary>/// <param name="sender"></param>/// <param name="e"></param>protected void Page_Load(object sender, EventArgs e){try{geovindu_TimeLineProjectInfo = geovindu_TimeLineProjectBLL.SelectGeovindu_TimeLineProject(1);geovindu_TimeLineAssetProjectInfo = geovindu_TimeLineAssetBLL.SelectGeovindu_TimeLineAssetProject(1);selectGeovindu_TimeLineDataProject = geovindu_TimeLineDataBLL.SelectGeovindu_TimeLineDataProject(1);for (int i = 0; i < selectGeovindu_TimeLineDataProject.Count; i++){selectGeovindu_TimeLineDataProject[i].TimeLineDataAssetInfo = geovindu_TimeLineAssetBLL.SelectGeovindu_TimeLineAssetData(selectGeovindu_TimeLineDataProject[i].TimeDataID);}//context.Response.ContentType = "text/plain";//context.Response.Write("Hello World");geovindu_TimeLineProjectInfo = geovindu_TimeLineProjectBLL.SelectGeovindu_TimeLineProject(1);geovindu_TimeLineAssetProjectInfo = geovindu_TimeLineAssetBLL.SelectGeovindu_TimeLineAssetProject(1);selectGeovindu_TimeLineDataProject = geovindu_TimeLineDataBLL.SelectGeovindu_TimeLineDataProject(1);for (int i = 0; i < selectGeovindu_TimeLineDataProject.Count; i++){selectGeovindu_TimeLineDataProject[i].TimeLineDataAssetInfo = geovindu_TimeLineAssetBLL.SelectGeovindu_TimeLineAssetData(selectGeovindu_TimeLineDataProject[i].TimeDataID);}JObject rss =new JObject(new JProperty("timeline",new JObject(new JProperty("headline", geovindu_TimeLineProjectInfo.TimeHeadline),new JProperty("type", geovindu_TimeLineProjectInfo.TimeType),new JProperty("text", geovindu_TimeLineProjectInfo.TimeText),new JProperty("startDate", geovindu_TimeLineProjectInfo.TimeStartDate.ToString("yyyy,MM,dd")),new JProperty("asset",new JObject(new JProperty("media", geovindu_TimeLineAssetProjectInfo.TimeAssetMedia),new JProperty("credit", geovindu_TimeLineAssetProjectInfo.TimeAssetCredit),new JProperty("caption", geovindu_TimeLineAssetProjectInfo.TimeAssetCaption))),new JProperty("date",from p in selectGeovindu_TimeLineDataProjectorderby p.TimeDataHeadlineselect new JObject(new JProperty("startDate", p.TimeDataStartDate.ToString("yyyy,MM,dd")),new JProperty("headline", p.TimeDataHeadline),new JProperty("text", p.TimeDataText),new JProperty("asset",new JObject(//geovindu_TimeLineAssetDataInfo=geovindu_TimeLineAssetBLL.SelectGeovindu_TimeLineAssetData(p.TimeDataID)new JProperty("media", p.TimeLineDataAssetInfo.TimeAssetMedia),new JProperty("credit", p.TimeLineDataAssetInfo.TimeAssetCredit),new JProperty("caption", p.TimeLineDataAssetInfo.TimeAssetCaption))))))));Response.Write(rss.ToString());File.WriteAllText(Server.MapPath("geovindu.json"), rss.ToString());}catch (Exception ex){Response.Write(ex.Message.ToString());}}}
}

csharp:Learn how to post JSON string to generic Handler using jQuery in ASP.Net C#.相关推荐

  1. perl malformed JSON string, neither tag, array, object, number, string or atom, at character offset

    [root@wx03 ~]# cat a17.pl use JSON qw/encode_json decode_json/ ; use Encode; my $data = [{'name' =&g ...

  2. json string 格式_自己动手实现一个简单的JSON解析器

    作者:田小波 原文:http://cnblogs.com/nullllun/p/8358146.html 1. 背景 JSON(JavaScript Object Notation) 是一种轻量级的数 ...

  3. 服务器返回一个无效的JSON string,处理

    使用AFN,服务端返回的结果看看哪里错了. 因为后台返回的不是一个有效的JSON string 所以库里面转化的时候一个error就抛出了.所以这时候,就自己做解析好了. NSLog ( @" ...

  4. json string 格式_GO小知识之如何做JSON美化

    经常有些小知识想分享出来,但又构不成体系,一直觉得文章形式发出不太合适.准备以 "知乎想法" 分享出来,但发现代码展示不太友好.还是发文章吧,该类分享将以 "小知识&qu ...

  5. Json string value cannot have line breaks(解决方法)

    Json string value cannot have line breaks(解决方法) 参考文章: (1)Json string value cannot have line breaks(解 ...

  6. java parse json string

    本例是最复杂的例子,本文可以从最简单的写起,由浅入深,一步一个例子写. 先从解析 { "key", "value"} 这种开始 数据源 { Routes = [ ...

  7. golang 结构体struct、数组、结构体数组 定义与赋值 、json string转struct

    文章目录 1.结构体struct 1.1 声明结构体 1.2 初始化结构体 以及 传参 2. 结构体数组.append 3. 接口返回 含数组的结构体 常用写法 json string转struct ...

  8. java jackson2.6_Jackson 2 - Convert Java Object to JSON and JSON String to Object

    在本教程中,我们将学习使用将JSON转换为Java对象 – 并将Java对象转换为JSON . 1. Jackson 2 maven dependency 要将Jackson 2库包含在您的项目中,请 ...

  9. 使用 Gson 将 Map、List等转换为json string

    示例: 将 Map 转为 json string 1.创建 Map 并初始化 Map<String, String> params = new HashMap<>(); par ...

最新文章

  1. MUI:字符串和json数据的相互转换
  2. 一些意想不到的小bug。
  3. BZOJ-1045 糖果传递 数学+递推
  4. visio调整形状位置_VISIO绘图技巧—三相桥式全控整流电路绘制
  5. ASP.NET MVC 2 学习笔记二: 表单的灵活提交
  6. C# Winfrom DataGridView DataSource绑定数据源后--解决排序问题
  7. 刚看到另外一个育儿作者收入是我的3000倍
  8. 聚类分析二:DBSCAN算法
  9. 常州模拟赛d3t2 灰狼呼唤着同胞
  10. 随机森林进行特征选择
  11. Google浏览器删除的书签怎么恢复?
  12. C++PrimerPlus 第六章 分支语句和逻辑运算符 - 6.1 if语句
  13. 35岁,技术转管理,空降新团队,测试管理的10问10答
  14. 空手套白狼-我的互联网草根创业亲身经历
  15. 计算机毕业设计Python+uniapp扫码点餐微信小程序(小程序+源码+LW)
  16. 【Android】RecyclerView的好伴侣:详解DiffUtil
  17. 展开运算符和object.assign()的区别
  18. pdf横向打印java_C#使用adobe acrobat reader命令行在横向打印PDF文档
  19. 调试 Windows 中的调试
  20. ChatGPT可以改变哪些行业?

热门文章

  1. c语言是函数式原型的编程,编程范式|程序世界里的编程范式,探索编程本质
  2. java的线程管理器,QuickThread - Java线程池管理器
  3. android intent 源码,Android 基础之 IntentService 源码
  4. 南航计算机硬件实验,南航80X86微机原理及接口技术实验指导书.pdf
  5. 征途单机版场景服务器端口被占用,模拟城市5解决端口被占用的方法
  6. 智能车竞赛技术报告 | 全向行进组 - 哈尔滨工业大学 - 紫丁香四队
  7. 2021年春季学期-信号与系统-第十二次作业参考答案-第二小题
  8. 室外电磁赛道铺设补充说明
  9. python 生产消费者_python之生产者消费者模型实现详解
  10. python安装程序打不开_使用PIP安装Python包会导致链接:致命错误LNK1104:无法打开文件“python27.lib”...