473,401 Members | 2,127 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,401 software developers and data experts.

Saving current ASP page to Server

LC
Hi,

I would like to know how I can save my current ASP page
to the server side in html file format.

Then I would like to stream it back to the client side.

Any help is very much appreciated.

Thanks,
LC
Jul 19 '05 #1
3 1573
write the content out to a string in the page instead of directly, then use
FSO to put the string contents into a file.

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"LC" <lc@hotmail.com> wrote in message
news:24****************************@phx.gbl...
Hi,

I would like to know how I can save my current ASP page
to the server side in html file format.

Then I would like to stream it back to the client side.

Any help is very much appreciated.

Thanks,
LC

Jul 19 '05 #2
Another option is to treat your page as the "remote" page in this sample,
http://www.aspfaq.com/show.asp?id=2173 (first code block), but instead of
Response.Writing the responseText, write it to a file with the File
Scripting Object.

Ray at work

"LC" <lc@hotmail.com> wrote in message
news:24****************************@phx.gbl...
Hi,

I would like to know how I can save my current ASP page
to the server side in html file format.

Then I would like to stream it back to the client side.

Any help is very much appreciated.

Thanks,
LC

Jul 19 '05 #3
"LC" <lc@hotmail.com> wrote in news:241901c4a247$498c84a0
$a*******@phx.gbl:
I would like to know how I can save my current ASP page
to the server side in html file format.


Copy/Paste the following:

'DEFINE YOUR FILE/FOLDER STUFF HERE
Dim Folder, File, WebPage
Folder = "c:\inetpub\wwwroot\"
File = "test.html"
WebPage = ""

'BUILD YOUR WEBPAGE HERE
Randomize
Write "The current time is: " & Now() & "<br>"
Write "Here's a random number: " & Int(Rnd(1)*500)+1 & ".<br>"

'I like how it boils down to this one line:
Save WebPage

'SUBROUTINES
Sub Write(myText)
'This sub is mainly here to cut down on the
'wear and tear of having to put this junk
'on every single line you want to append
'to the code, and to make sure it's easily
'readable when you view source

WebPage = WebPage & myText & vbcrlf
End Sub

Sub Save(myText)
'Creates the file in the location specified, and
'populates it with whatever is passed to it

Dim FSO, Stream, Overwrite, Unicode
Overwrite = True
Unicode = False
Set FSO = Server.CreateObject("Scripting.FileSystemObject")
Set Stream = FSO.CreateTextFile(Folder & File, Overwrite, Unicode)
Stream.Write myText
Stream.Close
End Sub
Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Kevin Ingram | last post by:
Ok, this is probably a silly question but I just keep hitting a brick wall here. I usually develop my sites entirely in ASP and use a database for data storage, works great for me. I also...
2
by: LC | last post by:
Hi, Many Weeks ago I posted this: I would like to know how I can save my current ASP page to the server side in html file format. I got a very nice reply back from Scott McNair. Thank you...
6
by: Greg Collins [MVP] | last post by:
For background, please refer to my original thread: http://groups.google.com/groups?selm=efe5w7tYEHA.3112%40tk2msftngp13.phx.gbl I've thought of a potential way around the issue, but I'm new to...
3
by: Clay Black | last post by:
I need to find a way to save an HTML page to the IIS server. What I need is to have a button that once it is clicked the current page being displayed is saved to a location on the local IIS...
3
by: jad101 | last post by:
I have an asp.net web page that: 1. Shows a message 2. Posts back (using javascript) 3. Reads contents of a file 4. response.write the contents of the file to the browser My issue is this: ...
0
by: DKode | last post by:
Hello, I am trying to call a UserControl after postback to save data filled out on that usercontrol to sql server. The problem I am having is this, I have 2 LinkButtons that I have setup as...
4
by: Pedro Leite | last post by:
Good Afternoon. the code below is properly retreiving binary data from a database and saving it. but instead of saving at client machine is saving at the server machine. what is wrong with my...
1
by: Jeff | last post by:
I need to place a "Previous Page" link on every page within my site and a simple javascript:history.back() will not work because I need it to capture the state of the page when I left it. For...
0
by: ll | last post by:
I'm currently working with an ASP page that populates rows based on a query for course data by using a DO WHILE NOT EOF loop. An improvement I'm adding is a dropdown populated by query which shows...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
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.