Microsoft.XMLHTTP ASP.NET

Discussion in 'ASP .Net' started by =?Utf-8?B?VGltOjouLg==?=, May 3, 2005.

  1. Can someone please help me with this annoying little problem...

    I use to use Microsoft.XMLHTTP in asp to pull html from other websites and
    inbed it into my website but for some reason I can't seem to find out how to
    do it in ASP.NET???

    I did find this example in C# but am not 100% sure it will do the same
    thing???

    I also want the following code in VB rather than C#

    Can someone please help me....

    Thanks

    <code>
    var req;

    function loadXMLDoc(url) {
    // branch for native XMLHttpRequest object
    if (window.XMLHttpRequest) {
    req = new XMLHttpRequest();
    req.onreadystatechange = processReqChange;
    req.open("GET", url, true);
    req.send(null);
    // branch for IE/Windows ActiveX version
    } else if (window.ActiveXObject) {
    req = new ActiveXObject("Microsoft.XMLHTTP");
    if (req) {
    req.onreadystatechange = processReqChange;
    req.open("GET", url, true);
    req.send();
    }
    }
    }
     
    =?Utf-8?B?VGltOjouLg==?=, May 3, 2005
    #1
    1. Advertising

  2. =?Utf-8?B?VGltOjouLg==?=

    Brock Allen Guest

    Are you looking to do this in the client or on the server? From the looks
    of it below you're doing it in the client (which really is independant of
    ASP.NET). If you're looking to do this server side then look into HttpWebRequest
    and HttpWebResponse classes in System.Net namespace.

    -Brock
    DevelopMentor
    http://staff.develop.com/ballen



    > Can someone please help me with this annoying little problem...
    >
    > I use to use Microsoft.XMLHTTP in asp to pull html from other websites
    > and inbed it into my website but for some reason I can't seem to find
    > out how to do it in ASP.NET???
    >
    > I did find this example in C# but am not 100% sure it will do the same
    > thing???
    >
    > I also want the following code in VB rather than C#
    >
    > Can someone please help me....
    >
    > Thanks
    >
    > <code>
    > var req;
    > function loadXMLDoc(url) {
    > // branch for native XMLHttpRequest object
    > if (window.XMLHttpRequest) {
    > req = new XMLHttpRequest();
    > req.onreadystatechange = processReqChange;
    > req.open("GET", url, true);
    > req.send(null);
    > // branch for IE/Windows ActiveX version
    > } else if (window.ActiveXObject) {
    > req = new ActiveXObject("Microsoft.XMLHTTP");
    > if (req) {
    > req.onreadystatechange = processReqChange;
    > req.open("GET", url, true);
    > req.send();
    > }
    > }
    > }
     
    Brock Allen, May 3, 2005
    #2
    1. Advertising

  3. =?Utf-8?B?VGltOjouLg==?=

    Scott Allen Guest

    Hi Tim:

    The example you are showing is in JavaScript, and would run in the
    client's browser.

    If you want to pull the HTML from your C# code, your best bet is the
    System.Net.WebClient and System.Net.WebRequest classes. The docs
    contain C# examples on how to use the classes and Google will turn up
    many more demonstrations.

    http://msdn.microsoft.com/library/d...ef/html/frlrfsystemnetwebclientclasstopic.asp
    http://msdn.microsoft.com/library/d...f/html/frlrfsystemnetwebrequestclasstopic.asp


    HTH,

    --
    Scott
    http://www.OdeToCode.com/blogs/scott/

    On Tue, 3 May 2005 02:40:03 -0700, "Tim::.." <myatix_at_hotmail.com>
    wrote:

    >Can someone please help me with this annoying little problem...
    >
    >I use to use Microsoft.XMLHTTP in asp to pull html from other websites and
    >inbed it into my website but for some reason I can't seem to find out how to
    >do it in ASP.NET???
    >
    >I did find this example in C# but am not 100% sure it will do the same
    >thing???
    >
    >I also want the following code in VB rather than C#
    >
    >Can someone please help me....
    >
    >Thanks
    >
    ><code>
    >var req;
    >
    >function loadXMLDoc(url) {
    > // branch for native XMLHttpRequest object
    > if (window.XMLHttpRequest) {
    > req = new XMLHttpRequest();
    > req.onreadystatechange = processReqChange;
    > req.open("GET", url, true);
    > req.send(null);
    > // branch for IE/Windows ActiveX version
    > } else if (window.ActiveXObject) {
    > req = new ActiveXObject("Microsoft.XMLHTTP");
    > if (req) {
    > req.onreadystatechange = processReqChange;
    > req.open("GET", url, true);
    > req.send();
    > }
    > }
    >}
     
    Scott Allen, May 3, 2005
    #3
  4. Thanks for the help guys!



    "Scott Allen" wrote:

    > Hi Tim:
    >
    > The example you are showing is in JavaScript, and would run in the
    > client's browser.
    >
    > If you want to pull the HTML from your C# code, your best bet is the
    > System.Net.WebClient and System.Net.WebRequest classes. The docs
    > contain C# examples on how to use the classes and Google will turn up
    > many more demonstrations.
    >
    > http://msdn.microsoft.com/library/d...ef/html/frlrfsystemnetwebclientclasstopic.asp
    > http://msdn.microsoft.com/library/d...f/html/frlrfsystemnetwebrequestclasstopic.asp
    >
    >
    > HTH,
    >
    > --
    > Scott
    > http://www.OdeToCode.com/blogs/scott/
    >
    > On Tue, 3 May 2005 02:40:03 -0700, "Tim::.." <myatix_at_hotmail.com>
    > wrote:
    >
    > >Can someone please help me with this annoying little problem...
    > >
    > >I use to use Microsoft.XMLHTTP in asp to pull html from other websites and
    > >inbed it into my website but for some reason I can't seem to find out how to
    > >do it in ASP.NET???
    > >
    > >I did find this example in C# but am not 100% sure it will do the same
    > >thing???
    > >
    > >I also want the following code in VB rather than C#
    > >
    > >Can someone please help me....
    > >
    > >Thanks
    > >
    > ><code>
    > >var req;
    > >
    > >function loadXMLDoc(url) {
    > > // branch for native XMLHttpRequest object
    > > if (window.XMLHttpRequest) {
    > > req = new XMLHttpRequest();
    > > req.onreadystatechange = processReqChange;
    > > req.open("GET", url, true);
    > > req.send(null);
    > > // branch for IE/Windows ActiveX version
    > > } else if (window.ActiveXObject) {
    > > req = new ActiveXObject("Microsoft.XMLHTTP");
    > > if (req) {
    > > req.onreadystatechange = processReqChange;
    > > req.open("GET", url, true);
    > > req.send();
    > > }
    > > }
    > >}

    >
    >
     
    =?Utf-8?B?VGltOjouLg==?=, May 3, 2005
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Charles A. Lackman
    Replies:
    1
    Views:
    1,362
    smith
    Dec 8, 2004
  2. SpamProof
    Replies:
    0
    Views:
    576
    SpamProof
    Oct 21, 2003
  3. Raúl Martín
    Replies:
    1
    Views:
    10,830
    Natty Gur
    May 13, 2004
  4. Matthew Leiderman

    Grabbing secure web page with Microsoft.XMLHTTP

    Matthew Leiderman, Jun 16, 2004, in forum: ASP General
    Replies:
    0
    Views:
    153
    Matthew Leiderman
    Jun 16, 2004
  5. yawnmoth

    Msxml*.XMLHTTP vs. Microsoft.XMLHTTP

    yawnmoth, Nov 7, 2006, in forum: Javascript
    Replies:
    11
    Views:
    389
    Matt Kruse
    Nov 9, 2006
Loading...

Share This Page