/// <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_TimeLineDataProject
orderby p.TimeDataHeadline
select 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. Array(数组)与Json String (Json字符串) 的相互转换

    1.Array转换成Json String             function jsonToString(arr) {             var s = "";     ...

  2. json string 与object 之间的转化

    1.将json string转化成object 1: public static T GetObjectFromJson<T>(string jsonString) 2: { 3: Dat ...

  3. 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' = ...

  4. Jackson将json string转为Object,org.json读取json数组

    从json文件读取json string或者自定义json string,将其转为object.下面采用的object为map,根据map读取json的某个数据,可以读取第一级的数据name,后来发现 ...

  5. Convert List<Entity> to Json String.

    public static string ToJson(this object obj, string datetimeformats) {     var timeConverter = new I ...

  6. 解决 Jackson反序列化 Unexpected token ... , expected VALUE_STRING: need JSON String that contains type id (for subtype of ...)

    首先检查是否是 objectMapper.enableDefaultTyping(); 的受害者.优先考虑删除该配置. 使用Jackson把数组的json字符串反序列化为List时候报了个JsonMa ...

  7. You're trying to decode an invalid JSON String JSON返回有解析问题

    SpringMVC架构的web程序,通常用map返回消息在浏览器中显示,但是实际中报下列错误“”You're trying to decode an invalid JSON String“返回的字符 ...

  8. How to remove null value in json string

    Hi I'm using the below class Public List<string> name; Public List<string> midname; Once ...

  9. FastJSON 简介及其Map/JSON/String 互转

    在日志解析,前后端数据传输交互中,经常会遇到 String 与 map.json.xml 等格式相互转换与解析的场景,其中 json 基本成为了跨语言.跨前后端的事实上的标准数据交互格式.应该来说各个 ...

随机推荐

  1. 对csrf的理解

    用户浏览并登陆信任网站A 通过验证,在用户浏览器产出A的cookie 用户在没有登出A的情况下访问攻击网站B B要求访问第三方站点A,发出一个请求 根据B的请求,浏览器带着A的cookie访问A A不 ...

  2. 北航软院2013级C#期末考试部分考题解答

    博主注:本渣渣水平有限,文中若有不对的地方敬请指出,谢谢. 本文中大部分图片来自老师的PPT,感谢邵老师,想要的可以点击右边QQ联系我:) 一.选择题 2.Wrong statement? A.dou ...

  3. CocoaPods的PodSpec.json文件用法

    最近有时候用最新的CocoaPod的第三方库,有时候发现CocoaPod.org能搜到那个Podfile,但是每次在终端Pod search xxx,每次都搜不到,原来是本地的Podspec没用更新, ...

  4. PowerBuilder中新建PBL

    首先需要打开工作区间workspace , 然后选择你的第一个根pbl文件. 如图所示: 选择WorkSpace下的第一个application.PBT文件,然后单击鼠标右键,选择属性Properti ...

  5. 【医学影像】《Identifying Medical Diagnoses and Treatable Diseases by Image-Based Deep Learning》论文笔记

    这篇论文的作者是张康教授为首的团队,联合国内外众多医院及科研机构,合力完成,最后发表在cell上,实至名归. 从方法的角度上来说,与上一篇博客中的论文很相似,采用的都是InceptionV3模型,同时 ...

  6. [Alpha]Scrum Meeting#3

    github 本次会议项目由PM召开,时间为4月3日晚上10点30分 时长15分钟 任务表格 人员 昨日工作 下一步工作 木鬼 撰写团队贡献分配计划(issue#39) 调整&分配工作 SiM ...

  7. Gson使用

    Gson提供了fromJson()方法来实现从Json相关对象到Java实体的方法. 在日常应用中,我们一般都会碰到两种情况,转成单一实体对象和转换成对象列表或者其他结构. 先来看第一种: 比如jso ...

  8. 转载 python文件复制的方法

    Python复制文件的9种方法 51Testing软件测试网 17-11-1614:13 以下是演示"如何在Python中复制文件"的九种方法. 1.shutil copyfile ...

  9. 3dsmax2015卸载/安装失败/如何彻底卸载清除干净3dsmax2015注册表和文件的方法

    3dsmax2015提示安装未完成,某些产品无法安装该怎样解决呢?一些朋友在win7或者win10系统下安装3dsmax2015失败提示3dsmax2015安装未完成,某些产品无法安装,也有时候想重新 ...

  10. https迁移实践手记

    前言什么是公钥和私钥?使用OpenssL生成私钥.使用Keytool导出私钥.主流数字证书都有哪些格式?SSL证书类型注册SSL证书使用OpenSSL工具生成CSR文件使用keytool工具生成CSR ...