XML display IE

S

stotty

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!
 
C

Curt_C [MVP]

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!

Sure... see my other reply to this question when you posted it last time :}
 
G

Guest

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!
***************************
 
B

begin22

The solution for IE sounds great but how does one go about changing the
MIME type to xml?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,262
Messages
2,571,042
Members
48,769
Latest member
Clifft

Latest Threads

Top