ASP.Net MVC和ExtJS之间的序列化和反序列化日期 [英] Serialize and Deserialize Date between ASP.Net MVC and ExtJS

查看:166
本文介绍了ASP.Net MVC和ExtJS之间的序列化和反序列化日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在搜索网页寻找一个解决方案,但仍然困扰。

I've been searching through the web to look for a solution for this but still stuck.

我遇到了序列化DateTime对象的困难。使用DataContract的标准序列化将给出此结果/日期(1262600239000)/。 Ext.encode之后,结果更改为/ Date(1262600239000)/。 Ext.encode的结果在ExtJS日期相关组件(如DateField和ColumnModel)中不可读取。

I'm having difficulties serializing DateTime object. The standard serialize using DataContract will give this result /Date(1262600239000)/. After Ext.encode the result changed to /Date(1262600239000)/. The result from Ext.encode is not readable in ExtJS date related components such as DateField and ColumnModel for date.

至于反序列化,我必须在此日期(1262600239000)/格式中提供日期,以反序列出日期。如何使用ExtJS DateField获得这个?

As for deserializing, i'd have to provide the date in this /Date(1262600239000)/ format in order to deserialize the date. How can i achive this with the ExtJS DateField?

有没有什么具体的方法来解决这个问题?

Is there any specific ways to get around this?

感谢提前。

推荐答案

你尝试过这个

这是ExtJS的覆盖'JSON编码和解码方法。确保阅读最后的评论。

It's an override for ExtJS' JSON encode and decode methods. Make sure to read the last comment as well.

这篇关于ASP.Net MVC和ExtJS之间的序列化和反序列化日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆