473,725 Members | 2,248 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1587
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.Writin g 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:241901c4a2 47$498c84a0
$a*******@phx.g bl:
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\www root\"
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.CreateOb ject("Scripting .FileSystemObje ct")
Set Stream = FSO.CreateTextF ile(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
609
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 sometimes save information to a text file on my server like c:\invoices\customername.txt for batch processing later... I use the FSO commands and it all works slick. Now, I have a new project: A client wants us to log in to their website on another...
2
1369
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 very much Scott. This code was provided by Scott:
6
1776
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 ASP.NET and C# and need the expertese of individuals with more experience in these languages than I have. I may be completely off target as I thought this up very early in the morning. Here's the process as I see it: 1. InfoPath saves out the...
3
1726
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 server. I know there are ways to go and get a page, but this one would be dynamic and wouldn't be saved so I would need to save it while it is still active or have it forwarded to an asp.net page that will take the html code and save it to a file. TIA...
3
1430
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: If a user hits this page and decides to save the page for offline browsing, they are not saving the output of the response.write, but instead the html that shows the message and calls
0
1126
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 tabs on my app, the user fills out information on UserControl_1, when they click a different tab, I want to load UserControl_2 and save the data that was entered into UserControl_1.
4
6723
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 code ?? thank you Pedro Leite From Portugal ------------------------------------
1
1822
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 example, if I have a page with some date controls so I can choose a date range and postback the page. It then displays results based on that date range. When I leave the page for another page, I would like to have the Previous Page link take them...
0
1581
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 each course number, so that the user can populate that course page with data from a previous course. My question is: once the data from the previous course is populating the current course page (after being selected from the aforementioned...
0
8752
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9257
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9179
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8099
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6702
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6011
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3228
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2637
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2157
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.