Read in XML file, output to screen...

C

CDZ

This seems simple enough, Read an XML file, output it to the screen.
Yes, I know that doesn't make sense but here's why I need it:

I have a sharepoint list that I'm viewing the XML from, the URL is LONG
and ugly, it comes from a .dll file. Ex:
http://domain/site/_vti_bin/owssvr.dll?Cmd=Display&List={85C78153-FD44-4384-B8B9-8D1AD96975DC}&XMLDATA=TRUE

I just want to create an asp.net / c# page that reads in the url above
and outputs raw xml using the .aspx extension.

Can you help?
Thanks
 
C

Cryptik

System.Net.WebClient client = new System.Net.WebClient();
string xmlData = client.DownloadString("http://myurl.com");
Response.Write(xmlData);

Just have to make sure the pages content type is text/xml.

Kelly S. Elias
Webmaster
DevDistrict - C# Code Library
http://devdistrict.com
 
C

CDZ

That worked exactly like I was thinking. I just get authenitcation
failed now though because the file it's grabbing isn't accessable...
but I'm closer now, thank you.
 

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

Top