Wednesday, 9 March 2011

Output XML from aspx page

Response.ContentType = "text/xml; charset=utf-8";

string myXML="" +
"<catalog>"+
   "<book id=\"book1\">"+
      "<author>Pitt, Ed</author>"+
      "<title>Another Programming Book</title>"+
    "</book>"+
  "</catalog>";

Response.Write(myXML);

No comments:

Post a Comment

Comments are moderated, so you'll have to wait a little bit before they appear!