Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Microsoft.XMLHTTP ASP.NET

Reply
Thread Tools

Microsoft.XMLHTTP ASP.NET

 
 
=?Utf-8?B?VGltOjouLg==?=
Guest
Posts: n/a
 
      05-03-2005
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();
}
}
}
 
Reply With Quote
 
 
 
 
Brock Allen
Guest
Posts: n/a
 
      05-03-2005
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();
> }
> }
> }




 
Reply With Quote
 
 
 
 
Scott Allen
Guest
Posts: n/a
 
      05-03-2005
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/de...classtopic.asp
http://msdn.microsoft.com/library/de...classtopic.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();
> }
> }
>}


 
Reply With Quote
 
=?Utf-8?B?VGltOjouLg==?=
Guest
Posts: n/a
 
      05-03-2005
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/de...classtopic.asp
> http://msdn.microsoft.com/library/de...classtopic.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();
> > }
> > }
> >}

>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57