Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > asp- printing html from url

asp- printing html from url
Thread Tools
Fresh-Faced Recruit
Join Date: May 2005
Status: Offline
Reply With Quote
Jan 4, 2006, 07:39 PM
 
Hi,

Could someone please share with me some sample code of how to use vbscript on an ASP page to display the html of another url? (I know that this is an ASP question posted on a Mac web site, but since everyone is always so helpful and knowledgeable here, I thought I'd ask anyway).

thanks :-)
     
Clinically Insane
Join Date: Nov 1999
Status: Offline
Reply With Quote
Jan 5, 2006, 09:19 AM
 
The trickiest part of this is actually getting the remote URL.

First question: are you trying to do this with server-side VBScript (as part of the ASP page), or client-side VBScript (generated by the ASP page)? I'm going to assume that you're talking about server-side stuff.

I'm not really familiar with ASP, so I had to do some digging on this. From what I can tell, you can't actually do this with VBScript alone; you have to use an ActiveX control. WebConcerns.co.uk has an article on this.[/url] Note that contrary to what the article says, you really are using an ActiveX control: it just happens to be built into the system. In fact, if you've ever written any AJAX, it should seem familiar: it's the ActiveX control off of which the de-facto standard XmlHttpRequest API (now in Mozila, Opera, Safari, and slated for IE/Windows 7.0) was based.

When you read in the URL, by default all you get is a string containing the test of the HTML page. You'll still have to parse it out and print it yourself. However, this works just as it would for any other string of text.
You are in Soviet Russia. It is dark. Grue is likely to be eaten by YOU!
     
Dedicated MacNNer
Join Date: Aug 2002
Status: Offline
Reply With Quote
Jan 7, 2006, 08:35 PM
 
I'll prefix this by saying most of what i've done on the windows side has been with c# in asp.net

if you're using visual basic.net, microsoft has a nice tutorial for how to download the data:
http://support.microsoft.com/default...b;en-us;301102

the most basic way to display the html instead of the browser evaluating it is a simple string replacement of all '<' to '&lt;'
     
   
Thread Tools
Forum Links
Forum 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 On
Top
Privacy Policy
All times are GMT -5. The time now is 07:47 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2