Add to Favorites    Make Home Page 8828 Online  
 Language Categories  
 Our Services  

Home » ASP Home » HTML Formatting Home » ASP to static HTML for speed


Search Projects & Source Codes:

Title ASP to static HTML for speed
Description If you have a large amount of data to give to the user as HTML and this data needs to change once a day then this will speed up the process for the user. The following code will create a file the first time a page is hit for each day. The upside of doing it this way is you have a record of what the use saw on any given day. The downside is the first person takes the performance hit to write the page and you need to check to make sure the user came to this page first. In other words, if they save yesterdays page as a fovorite then they will see old data unless you redirect. I used the month and day to handle this problem. I did not use the year. There are many other ways to handle this problem.
Category ASP » HTML Formatting
Hits 324353
Code Select and Copy the Code
Dim fs, fsmyfile, todayfile, ckdayfile, cr, qt 'Get name of file as it needs to be toda ' y todayfile="Cur"&CStr(Month(Date()))&CStr(Day(Date())) ckdayfile=""&CStr(Month(Date()))&CStr(Day(Date()))&"" todayfile=Trim(todayfile)&".asp" 'Create FileSystemObject Set fs = CreateObject("Scripting.FileSystemObject") 'File may not be built On Error Resume Next 'Check to see if we already have the HTM ' L file Built Set fsmyfile = fs.OpenTextFile("c:inetpubscriptsaspjeff"+todayfile,1,0) If err<>0 Then 'Need To build today fsmyfile.Close 'Close File Set fsmyfile = fs.OpenTextFile("c:inetpubscriptsaspjeff"+todayfile,8,1,0) cr=Chr(13) 'Save some typing (I'm lazy) qt=Chr(34) 'The Only way I could Get the quote marks correct codeout="<%@ LANGUAGE=""VBSCRIPT"" %"&">"&cr codeout=codeout&"<%"&cr codeout=codeout&"today="&qt&CStr(Month(Date()))&CStr(Day(Date()))&qt&cr codeout=codeout&cr&"if today<>"&qt&ckdayfile&qt&" then"&cr codeout=codeout&"response.redirect("&qt&"wrtest.asp"&qt&")"&cr codeout=codeout&"else %"&">"&cr fsmyfile.Writeline(""&codeout&cr&_ "<HTML>"&cr&_ "<TITLE>Write and Check Raw HTML For Speed</TITLE>"&cr&_ "<BODY>"&cr&_ "Hello todays file is called "&todayfile&cr&_ "</BODY>"&cr&_ "</HTML>"&cr&_ "<"&"%End if"&cr&_ "%"&">") fsmyfile.close fs.close Response.Redirect(todayfile) 'Send them to new file Else fsmyfile.close fs.Close Response.Redirect(todayfile) 'Send them to current file End if%>

Related Source Codes

Script Name Author
ııııııııııııııııııııı VyomWorld
Resistor color code reader A.Chermarajan.
Telephone Directory dhivya
card swapping game (Mini Project) nityanand
simple hangman-pascalsource Seabert
college dirtectory (Mini Project) msridhar
Poll Application John van Meter
ASP Daily Hit Counter. Tejaskumar Gandhi
To avoid null in asp environment using sql Sami
Maklumbalas webmaster
poll John van Meter
EasyASP Template Engine. TjoekBezoer
Basic Calculator using HTML & Javascript. Patrick M. D Souza
What servers support ASP ? VyomWorld
What is ASP? VyomWorld


Google Groups Subscribe to SourceCodesWorld - Techies Talk

Free eBook - Interview Questions: Get over 1,000 Interview Questions in an eBook for free when you join JobsAssist. Just click on the button below to join JobsAssist and you will immediately receive the Free eBook with thousands of Interview Questions in an ebook when you join.

New! Click here to Add your Code!

ASP Home | C Home | C++ Home | COBOL Home | Java Home | Pascal Home
Source Codes Home Page


Google Search


Source Codes is a part of Vyom Network.

Vyom Network : Web Hosting | Dedicated Server | Free SMS, GRE, GMAT, MBA | Online Exams | Freshers Jobs | Software Downloads | Interview Questions | Jobs, Discussions | Placement Papers | Free eBooks | Free eBooks | Free Business Info | Interview Questions | Free Tutorials | Arabic, French, German | IAS Preparation | Jokes, Songs, Fun | Free Classifieds | Free Recipes | Free Downloads | Bangalore Info | Tech Solutions | Project Outsourcing, Web Hosting | GATE Preparation | MBA Preparation | SAP Info | Software Testing | Google Logo Maker | Freshers Jobs

Sitemap | Privacy Policy | Terms and Conditions | Important Websites
Copyright ©2003-2022, All Rights Reserved.
Page URL:

Download Yahoo Messenger | Placement Papers | Free SMS | C Interview Questions | C++ Interview Questions | Quick2Host Review