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

  • SEARCH
  • Home
  • 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 6552061
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:24:52+00:00 2026-05-25T12:24:52+00:00

From within my .aspx page I am trying to make a request to an

  • 0

From within my .aspx page I am trying to make a request to an xml page that is on the web and return the value of one of the nodes. The page in question will be a service that accepts a query string and outputs the results to my own aspx page.

For learning purposes though I am just trying to make a simple example. I have found this page: http://www.w3schools.com/xml/note.xml What I would like to do is have a button that when clicked will display to a textbox the value of the < body>< /body> node?

I have been trying to do it with the WebClient Class but I’m not positive if this is the correct way to go about it. I have been following this example http://www.codeproject.com/script/Articles/ViewDownloads.aspx?aid=33798 but I am encountering exception (407) Proxy Authentication Required.

  • 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-25T12:24:53+00:00Added an answer on May 25, 2026 at 12:24 pm

    You could use LINQ to XML like so to load the XML and retrieve the elements you wish:

    XDocument document = XDocument.Load("http://www.w3schools.com/xml/note.xml");
    string xml = document.Root.ToString();
    

    Using your example (http://www.w3schools.com/xml/note.xml), the above would output the following:

    <note>
        <to>Tove</to>
        <from>Jani</from>
        <heading>Reminder</heading>
        <body>Don't forget me this weekend!</body>
    </note>
    

    Hope this helps.

    Edit (Based on comment)

    If you are sitting behind a proxy server and have default credentials setup you can try the following (untested as not behind proxy):

    HttpWebRequest webRequest = (HttpWebRequest)HttpWebRequest.Create("http://www.w3schools.com/xml/note.xml");
    webRequest.Proxy = WebRequest.DefaultWebProxy;
    using (HttpWebResponse webResponse = (HttpWebResponse)webRequest.GetResponse())
    {
        using (StreamReader streamReader = new StreamReader(webResponse.GetResponseStream()))
        {
            XDocument document = XDocument.Load(new StringReader(streamReader.ReadToEnd()));
            string xml = document.Root.ToString();
            MessageBox.Show(xml);
        }
    } 
    

    Note

    (From MSDN WebRequest.DefaultWebProxy Property)

    The DefaultWebProxy property reads proxy settings from the app.config
    file. If there is no config file, the current user’s Internet Explorer
    (IE) proxy settings are used.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to return a transparent GIF from an .aspx page for display within
Trying to get a text value either yes or no from an aspx page
We're trying to create a .NET aspx page that will have a PDF within
Preface: I've got a System.Web.UI.WebControls.Table on my ASPx page that I define within the
From within a DLL that's being called by a C#.NET web app, how do
I'm trying to embed a ChartModule.aspx page within a Default.aspx page using an iframe
I am trying to open an preview.aspx page in a seperate window from INSIDE
I have created a web custom control and used within an aspx page. I
How do I access the ModelState from within my View (aspx page)?
I'm trying to server an exe to Firefox from an aspx page. The aspx

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.