![](/img/trans.png)
[英]Is it possible to Serialize/Deserialize Session object in asp.net
[英]How can I serialize an object in Javascript, then deserialize it in asp.net?
我有一个具有几个字符串和浮点成员的自定义Javascript对象。 我想在Javascript中序列化它们的数组,将结果分配给一个隐藏字段,然后在asp.net应用程序的背后代码中检索并反序列化它们。
有标准的方法吗?
您可以使用JSON。
使用JSON,您可以序列化数据并以其他语言对其进行序列化。
http://flexjson.sourceforge.net/
http://forums.c-sharpcorner.com/Blogs/BlogDetail.aspx?BlogId=2028
http://www.nateirwin.net/2008/11/20/json-array-to-c-using-jsonnet/
http://msdn.microsoft.com/en-us/library/bb299886.aspx
http://www.codeproject.com/Tips/79435/Deserialize-JSON-with-Csharp.aspx
您需要的是JSON
。
javascript和C#都可以处理。
文章: http : //www.nateirwin.net/2008/11/20/json-array-to-c-using-jsonnet/
还: http : //www.json.org/ (滚动到末尾)
编辑:
由于不推荐使用JavaScriptSerializer
..您可以使用DataContractJsonSerializer
。 MSDN: DataContractJsonSerializer关于如何使用它的博客文章: http : //pietschsoft.com/post/2008/02/NET-35-JSON-Serialization-using-the-DataContractJsonSerializer.aspx
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.