Microsoft.XMLHTTP ASP.NET

G

Guest

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();
}
}
}
 
B

Brock Allen

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.
 
S

Scott Allen

G

Guest

Thanks for the help guys!



Scott Allen said:
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,
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top