I provide data in server ,and want to send it to client,I use ashx with method ProcessRequest.
public override void ProcessRequest ( HttpContext context )
{
string html="";
//do sth for get html
context.Response.Write ( html.ToString() );
}
in client ,I render page with ajax.
so, I want get a json object in client, how to do it? how to bulid a json in sever side?
Use JSON serialization in .net version >= 3.5.
A little example:
You can find
DataContractJsonSerializerin System.Runtime.Serialization.dll