Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7398597
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T03:53:23+00:00 2026-05-29T03:53:23+00:00

WebRequest req = HttpWebRequest.Create(http://example.com/example); WebResponse res = req.GetResponse(); StreamReader sr = new StreamReader(res.GetResponseStream()); string

  • 0
    WebRequest req = HttpWebRequest.Create("http://example.com/example");
    WebResponse res = req.GetResponse();
    StreamReader sr = new StreamReader(res.GetResponseStream());
    string str = sr.ReadToEnd();
    XmlDocument doc = new XmlDocument();
    doc.LoadXml(str);
    XmlTextWriter writer = new XmlTextWriter("D://myGameSite//myGames.xml", null);
    writer.Formatting = Formatting.Indented;
    doc.Save(writer);**strong text**
    Response.Write(doc);

now this code is working perfectly I mean it saves the XML file in the root directory of the myGameSite with the file named myGames, but when I try to display this XML file in browser as you can see in the code, it just plainly displays this

    System.Xml.XmlDocument

I want to display this XML file in my browser along with the tags, and the version of my asp.net and .netframework is 2.0 so please I can’t use LINQ 🙁

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T03:53:23+00:00Added an answer on May 29, 2026 at 3:53 am

    This will do 😉

    Response.Write("<pre><code>" + Server.HtmlEncode(doc.InnerXml) + "</code></pre>");
    

    EDIT

    Or you can display the xml in a textarea

    <asp:TextBox ID="txtXml" runat="server" TextMode="MultiLine" Height="500px" Width="600px" />
    

    Code behind

    // This will preserve indentation 
        txtXml.Text = doc.InnerXml;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following two observables System.Net.WebRequest req = System.Net.HttpWebRequest.Create(http://test.com/data.xml); req.Method = HEAD; var
I am using this code: HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url); string result = null; using
XDocument xDoc = new XDocument(); HttpWebRequest req = (HttpWebRequest)WebRequest.Create(uri); req.Timeout = 1000 * 60
I originally used WebRequest and WebResponse to sent Http Post Messages. Always I got
Here is a snippet of the code : HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(request.RawUrl); WebRequest.DefaultWebProxy =
I know about the WebRequest and the WebResponse objects. The problem is that I
I'm trying to log onto the following website using HttpWebRequest: http://mostanmeldung.moessinger.at/login.php Texts are in
I've have some code similar to this: HttpWebRequest req; HttpWebResponse response; Stream receiveStream =
I was trying to hit a web service using the instructions here: http://help.seeclickfix.com/kb/api/creating-an-issue I
Using WebRequest I want to know if I get a 302 Moved Temporarily response

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.