Help | Site Map
Connecting Tech Pros Worldwide
Reply
 
LinkBack Thread Tools
  #1  
Old September 9th, 2008, 11:04 PM
Newbie
 
Join Date: Sep 2008
Location: Denmark
Age: 22
Posts: 5
Default how to process html within asp

Hi there

I'm new here so please be patient if the question has been asked before.

My problem is that i receive a html-page from an external page(using WinHttpRequest 5.1 (see http://msdn.microsoft.com/en-us/libr...06(VS.85).aspx for more information)) and then I need to proces the received html, a bit like http://bytes.com/forum/thread55229.html except that i don't have it like a file. I've searched the internet for how-to about the HTMLFile object but could not find anything.

Can someone help me by telling me what the HTMLFile object can do? does it have methods like the javascript getElementById and so on.

Also I know my host supports microsoft HTML Object Library but can't find anything about this either so maybe this is another solution?

by the way, I won't post the html-page here since it is very long and very ugly, I can post my javascript version of what information I want from the html-page if you want it.

Thanks
KalleMOD
Reply
  #2  
Old September 11th, 2008, 08:29 PM
jhardman's Avatar
Moderator
 
Join Date: Jan 2007
Location: logan, utah
Age: 32
Posts: 2,363
Default

so is the received file in a long string?
Reply
  #3  
Old September 13th, 2008, 04:25 PM
Newbie
 
Join Date: Sep 2008
Location: Denmark
Age: 22
Posts: 5
Default

Quote:
Originally Posted by jhardman
so is the received file in a long string?
Yes it is, I receive it with WinHttpRequest's responseText method which returns the html as a long string
Reply
  #4  
Old September 15th, 2008, 03:49 PM
jhardman's Avatar
Moderator
 
Join Date: Jan 2007
Location: logan, utah
Age: 32
Posts: 2,363
Default

hmm. I can't find any info on it. What language are you using? Is this an ASP.NET object or a "classic" ASP object (server.createobject)?

Jared
Reply
  #5  
Old September 16th, 2008, 09:34 AM
Newbie
 
Join Date: Sep 2008
Location: Denmark
Age: 22
Posts: 5
Default

No it is classic asp and the link i provided looks like classic asp too so i guess there should be an object called HTMLFile in classic asp :)

maybe we could find the guy from http://bytes.com/forum/thread55229.html and ask him for help :)

KalleMOD
Reply
  #6  
Old September 16th, 2008, 08:36 PM
jhardman's Avatar
Moderator
 
Join Date: Jan 2007
Location: logan, utah
Age: 32
Posts: 2,363
Default

Quote:
Originally Posted by KalleMOD
No it is classic asp and the link i provided looks like classic asp too so i guess there should be an object called HTMLFile in classic asp :)

maybe we could find the guy from http://bytes.com/forum/thread55229.html and ask him for help :)

KalleMOD
The fso.readall method returns a long string with the entire text of the file. I still can't find any info on the HTMLFile object, but in that example (thread55229) he uses the doc.write command along with the readall method to put the entire HTMLFile in the doc object. I would suggest something like this:
Expand|Select|Wrap|Line Numbers
  1. doc.write myLongString
Let me know if this works.

If all else fails you could use the FSO to save the file as a temp file and then use that exact method to handle it, but this doesn't seem like a very elegant solution.

Jared
Reply
  #7  
Old September 16th, 2008, 09:47 PM
Newbie
 
Join Date: Sep 2008
Location: Denmark
Age: 22
Posts: 5
Default

well I've tried to use the HTMLFile.write method with my response-html but it didn't print anything when I tried response.write HTMLFile afterwards and the biggest problem is that I have no clue what methods that HTMLFile have :(

/KalleMOD
Reply
Reply

Bookmarks

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 Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles