Read in XML file, output to screen...

  • Thread starter Thread starter CDZ
  • Start date Start date
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
 
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
 
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.
 
Back
Top