By Mike Wasson. This tutorial shows how support additional media formats in ASP. NET Web API. Internet Media Types. A media type, also called a MIME type, identifies. JSON character escaping function in classic ASP Available with new domain webdevbros. Generate JSON from VBScript ASP datatypes. I am Java developer new to. NET. I am working on a. Net MVC2 project where I want to have a partial view to wrap a widget. Each JS widget object has a JSON data. This article explains how to convert a DataTable to JSON in ASP. NET C. Well use a Word. Press post an an example. By Mike Wasson. This article describes the JSON and XML formatters in ASP. NET Web API. In ASP. NET Web API, a mediatype formatter is an object that can. In my particular situation, I have a couple of solutions to my problem. I want to find out which one is more feasible. In this case, I can also achieve my goal by. Imagine a Word. Press Web Service plugin that has a Get. Posts function. This function returns one or more Word. Press posts in JSON format, looking like this ID 1. This is the content of the post,posttitle An example Post,postcategory 0,postexcerpt ,poststatus publish,commentstatus open,pingstatus open,postpassword ,postname product test,toping ,pinged ,postmodified 2. In the example above, one Word. Press blog post is returned with an ID of 1. An example Post. Step 1. In C, the first step is to create a class to contain the JSON object. So, we create a Post class. Post. public intID. For a successful deserialization of JSON into the C object, its important that the field names match the JSON data. Step 2. Next, we need to deserialize convert the JSON data into the C object. In this example, json. Response is a string containing the JSON data and were going to create a List of Post objects that contain all the posts returned by the Web Service. System. Web. Script. Serialization. Java. Script. Serializer ser new Java. Script. Serializer. Listlt Post postdata ser. Deserializelt Listlt Post json. Response. Step 3. OK, now we have a variable postdata containing all the posts in a List object. Each item is a Post object. Now, we can serialize this data into an XML object. In this example, well write the XML to a String but you could of course convert into an Xml. Document. using System. IO. using System. Xml. using System. Xml. Serialization. String. Writer sw new String. Writer. Xml. Writer xmlw Xml. Writer. Createsw. Xml. Serializer serializer new Xml. SerializertypeofList. Xml. Serializer. Namespaces ns new Xml. Serializer. Namespaces. Add, Omit namespace. Serializexmlw, postdata, ns. XML sw. To. String. The Xml. Serializer. Namespaces lines above arent required, but they avoid the XML containing any generated namespace values. Thats it, your XML string the. XML will now look something like this lt Array. Of. Post lt Post lt ID 1. ID lt postauthor 1lt postauthor lt postdate 2. This is the content of the postlt postcontent lt posttitle An example Postlt posttitle lt postcategory 0lt postcategory lt postexcerpt lt poststatus publishlt poststatus lt commentstatus openlt commentstatus lt pingstatus openlt pingstatus lt postpassword lt postname product testlt postname lt toping lt pinged lt postmodified 2. Post lt Array. Of.