易截截图软件、单文件、免安装、纯绿色、仅160KB

JSON Serialization and Deserialization in ASP.Net


    
JSON Serialization and Deserialization in ASP.Net
 
I was looking around for a simple example which would just do an object serialization to a JSON format, and then deserializing back to the original object. I found few examples on MSDN, but did seem to be too long to try. Here I've given a simple code which would make your understanding easy, and simpler.
 
 
What is JSON?
 
JSON is another format of expressing data, just like XML. But, JSON is very simpler than XML, and tiny than XML. So, it is becoming popular in the web world to choose the JSON notation over XML since JSON notation are usually shorter, and less data to be transmitted if at all they were to be.
 
Okay, I understood a little about JSON. Give me an example!
 
I know an example will get your understanding much better. Below is a simple example of how an object can be expressed in JSON notation. Let's take a classical example of a Person object, and expressing myself as an object.
{
   "firstName": "Rakki",
   "lastName":"Muthukumar",
   "department":"Microsoft PSS",
   "address": {
      "addressline1": "Microsoft India GTSC",
      "addressline2": "PSS - DSI",
      "city": "Bangalore",
      "state": "Karnataka",
      "country": "India",
      "pin": 560028
   }
   "technologies": ["IIS", "ASP.NET","JavaScript","AJAX"]
}
In the above example, address is another object inside my Person, and technologies is an array or strings.
 
Express this as a simple .NET class, please!
 
Here is a simple example.
public class Address
{
    public string addressline1, addressline2, city, state, country;
    public int pin;
}
 
public class Person
{
  


相关文档:

ASP.NET页面缓存的几点体会

ASP.NET页面缓存的几点体会
尽管本文的作者写的很简单,但是相信通过这些文字,还是能对大家了解ASP.NET页面缓存有很大的帮助。
前几天遇到个问题,百思不得其解。后来查阅了一些资料心里才有了点思路。把自己遇到的问题记录下来希望能给其他的园友一些帮助吧。
事情是这样的。我的一个ASP.NET页面用window.open导航后 ......

解决datalist中单选按钮可以多选的问题(Asp.Net)

问题描述:
Asp.Net中datalist等web控件里面,放多个单选按钮的时候可以同时多选,可以采取以下放法。
问题解决:
最理想的解决之道,用javascript:
<script language="javascript" type="text/javascript">
function clickit() {
        var dom=document.all;
 & ......

asp.net 用继承方法实现页面判断session

在做ASP项目的时候,判断用户是否登陆常用的方法是在每个页面判断session是否存在,
无奈用java的时候过滤器就用的不熟。。。还是用继承吧。汗。。。
新建一个类
Csharp 代码
  using   System;  
  using   System.Web;  
  using   System.Web ......

ASP.NET 单点登录

译文原文地址
http://www.cnblogs.com/hl13571/archive/2008/01/28/1056671.html
英文原文地址
Understanding Single Sign-On in ASP.NET 2.0
理解ASP.NET 2.0中的单点登录
Published: 16 Jan 2008
摘要
在这篇文章中,Masoud讨论了应用ASP.NET中统一身份验证模型进行跨应用程序验证的问题,包括:Membership Prov ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号