/// <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. mysql数据库表的基本操作sql语句总结

    1,命令行登录命令 mysql -h localhost -u root -p C:\Users\lenovo>mysql -u root -p Enter password: ***** We ...

  2. docker安装mysql57

    提升应用交付效率 1. 支持服务发现,避免服务重启迁移 IP 变更带来影响:2. 支持微服务化,降低代码维护及重构复杂度,适应快速变化的业务需求. 快速响应业务变化 1. 灵活水平扩展,应对业务量的骤 ...

  3. css3中的translate,transform,transition的区别

    translate:移动,transform的一个方法               通过 translate() 方法,元素从其当前位置移动,根据给定的 left(x 坐标) 和 top(y 坐标) ...

  4. (STM32F4) IAP程式碼實現

    IAP學習, 主要想了解實際上程式碼放在不同的Flash位置如何轉跳且執行. 我的應用程序只做了Pin12, Pin13 LED閃爍來分辨我的 App1 跟 App2的程式碼 App1 程式碼 int ...

  5. SELinux 引起的 Docker 启动失败

    问题描述 Linux OS 版本 CentOS Linux release 7.2.1511 (Core) 启动Docker service docker start 启动失败信息 原因分析 Erro ...

  6. ubuntu安装TFTP

    参考: http://wenku.baidu.com/view/76e70cd702d276a201292e2f.html?re=view http://wenku.baidu.com/view/ce ...

  7. Watchbog挖矿病毒程序排查过程

    第1章 情况 1)服务器收到cpu报警,cpu被占用达到100%,登录服务器查看,发现cpu被一个watchbog的进程占满了,如下图所示: 2)并且无论如何都杀不掉,用kill杀掉后,其还是会隔一会 ...

  8. appium关于当前网络情况测试,实现打开关闭网络(python3.4版)

    appium关于当前网络情况测试,实现打开关闭网络(不需要root测试机) # python from appium.webdriver.connectiontype import Connectio ...

  9. Oracle远程数据建物化视图(materialized)创建简单记录,以及DBLINK的创建

    目的:实现远程数据库访问及其相应表的定时同步 一.远程数据库dblink的创建 select * from dba_db_links; select * from user_sys_privs;--查 ...

  10. 2.使用ngx_http_auth_basic_module模块为不带认证的资源添加授权

    1.首先需要生成用户名和密码 使用openssl来生成,生成命令(openssl在安装nginx的时候已经安装) echo "kibana:$(openssl passwd -crypt y ...