{
public string State { get; set; }
public string Zip { get; set; }
}
public void ProcessRequest(HttpContext context)
{
//write your handler implementation here.
XDocument xdoc = XDocument.Load(context.Server.MapPath("Listings.xml"));
var feeds = from feed in xdoc.Descendants("Categories")
select new FeedDefintion { State = feed.Element("State").Value, Zip = feed.Element("Zip").Value };
List
System.Web.Script.Serialization.JavaScriptSerializer oSerializer =
new System.Web.Script.Serialization.JavaScriptSerializer();
string sJSON = oSerializer.Serialize(fl);
//context.Response.ContentType = "application/json";
context.Response.ContentType = "application/json";
sJSON = context.Request.QueryString["callback"] + "(" + sJSON + ");";
context.Response.Write(sJSON);
}
No comments:
Post a Comment