473,404 Members | 2,178 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

asp page to html

11
I'm working on a webapplication that is running asp with vbscript. I made a function that prints the current page to a pdf. I needed to add everything that I write to the browser into a string and give that string to the component. Not a hard task but quite annoying thou. I was wondering if there is an easy way to get the full generated html code into a string easier.
Now I make a new page and instead of response.write etc. I just add it to the string. This lowers performance and recalculates everything that was needed.

So it would be handy if I could have a button that just copys the current html page into a string. Any help or suggestions are highly appreciated.

Greetings woony
Dec 18 '07 #1
2 1075
Nicodemas
164 Expert 100+
You could use the XML HTTP Request COM to retrieve the response from the executed page.

I've written a little script for one of my own app's that will help you. The function will pass back the response text from the retrieved URL in string format. Just dump that into your PDF.

Expand|Select|Wrap|Line Numbers
  1. <%
  2. '//===========================================
  3. '//
  4. '// Author: Robert "Nicodemas" Simpson
  5. '//
  6. '// Website: http:nicodemas.com
  7. '//
  8. '// Function [Boolean] XmlHttpRequest([in] string: sOperation,
  9. '//                                   [in] string: URL,
  10. '//                                   [in] string: XML,
  11. '//                                   [out]string: ResponseText)
  12. '//
  13. '// This function:
  14. '//      - executes a request to a remote URL, and
  15. '//      - returns the response thru arg. list.
  16. '//===========================================
  17.  
  18. function XmlHttpRequest(sOperation, URL, DataToSend, ResponseText)
  19.    dim oXml
  20.  
  21.    '//----------------------------------------------------
  22.    '// by default, function result is false
  23.    '//----------------------------------------------------
  24.    XmlHttpRequest = false
  25.  
  26.    sOperation = ucase(trim(sOperation))
  27.  
  28.    if sOperation = "" or (sOperation <> "GET" or sOperation <> "POST") then sOperation = "GET"
  29.    if URL = "" then exit function
  30.  
  31.    set oXml = server.createobject("microsoft.xmlhttp")
  32.  
  33.    oXml.open sOperation, URL, false
  34.    oXml.send DataToSend
  35.  
  36.    ResponseText = oXml.responsetext
  37.  
  38.    set oXml = nothing
  39.  
  40.    XmlHttpRequest = true
  41. end function
  42.  
  43. if XmlHttpRequest("GET", "http://url/to/the/page", "", theResponse) then
  44.    '// dump [theResponse] into your PDF
  45. end if
  46. %>
Dec 19 '07 #2
woony
11
thank u, I'll try it out
Dec 19 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Arun Nair | last post by:
Hi, I have the following jsp page. I am able to view only a part of it(until the occurence of the first City text box). If i remove the first few fields from the page, I am able to see a few...
2
by: Jon Haakon | last post by:
Hi, I'm developing a websolution using ASP and DHTML technology that's running on a MS IIS webserver. My solution is frame based with a toolbar on top, a hidden frame for scripts in the...
1
by: Randi | last post by:
Hi all, I there any way of putting an html hyperlink into a .xml file, and still be able to use the xml tags to format the page? Here is the code of the xml file(real simple) and the .css file. ...
2
by: John Lau | last post by:
Hi, Is there documentation that talks about the page lifecycle, the lifecycle of controls on the page, and the rendering of inline code, in a single document? Thanks, John
5
by: murrayatuptowngallery | last post by:
I'm caught in a classic finger-pointing situation. My hosting company's server appears to be automatically inserting JS tags into a JS-free html page that has an image inked to a 2nd page with...
6
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of...
13
by: Dan Aldean | last post by:
Hi, I use ASP.NET 2.0 and I created a stylesheet, but I don't know how to make it visible to a web form "MyWebPage.aspx" that uses the master page. I put a reference to the css in the .master...
17
by: =?Utf-8?B?Y2F0aGFyaW51cyB2YW4gZGVyIHdlcmY=?= | last post by:
Hello, I have build a website with approximately 30 html-pages. When I search this website in Google, I see the index.html or home.html on this website, but also other html-pages on this...
4
Death Slaught
by: Death Slaught | last post by:
im making a web site for a friend and i need a section of a-z links on a music page that have all the artist there that start with that letter but it wont open. heres the code to the music page. ...
10
by: paulie | last post by:
Hi, I have been experiencing an issue when trying to use AJAX to reload a DIV area using a timer of 2000ms, which contains a html page with another DIV and javascript. Scenario -------------...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.