Set MIME type to XML in the header and then stream the XML to the client
browser outside of the normal ASP.NET page framework.
How? (high level)
1. On the page that "delivers" the XML, remove all tags other than the @
directive
2. In the background, set the header MIME type to XML
3. Write out the XML text to the browser
If the browser is IE, you will now see the lovely color coding with the
collapsable nodes.
Want to roll your own to work with all browsers? If so, you will have to
grab each node and write it out as color coded text. I would encapsulate this
logic in a class so it is reusable or even make an HTTP handler that
intercepts XML output and does it for you.
--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
***************************
Think Outside the Box!
***************************
"st****@gmail.com" wrote:
Hey,
I have a string which contains an xml document in my asp.net
application. All I want to do is display this string/document in my
browser, however I want it to look nice and formatted. Essentially I
want the colour coding and the +/- to be there when I output this xml
document to my browser (like I would get if i opened an xml file with
IE).
Any ideas on how to do this...Seems like it should be simple but I'm
stuck...
Thanks!