Forum Moderators: open

Message Too Old, No Replies

Multiple Page Generator

         

njabe567

7:06 pm on Jun 29, 2007 (gmt 0)

10+ Year Member



I have an ASP site, trying to figure out an easier way of making multiple pages. Instead of actually creating a page over and over manually. The template will stay the same, similar urls. For example:

www.example.com/iowa.asp
www.example.com/florida.asp
www.example.com/texas.asp

So basically the pages will all generally look the same but the content will be different. Im not to sure if what Im asking is ridiculous but I figured their is some sort of app that can do this. Thanks

mattglet

3:57 am on Jul 1, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You're going to need some sort of URL rewriting tool. You can either build your own, or install a 3rd party tool.

dukelips

7:07 am on Jul 2, 2007 (gmt 0)

10+ Year Member



y dont u divide the page into 3 sections

top & bottom section (static)
Content sections gets changed

njabe567

4:58 pm on Jul 2, 2007 (gmt 0)

10+ Year Member



Yes I can do that , but the actual right clicking ..create new asp file...etc etc...I dont want to do that over 100 times....Ill look into thrid party software but can anyone point me in the right direction?

mattur

11:38 am on Jul 3, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can use the FileSystemObject to create pages in ASP, in a Microsoft app like Access or via a local WSH script.

Here's an example ASP sub to create a file:


Sub CreateFile(strFilePath, strContent)
Dim fso
Dim txs
'overwrite file if it already exists
Const FILE_OVERWRITE = True
'setup filesystemobject
Set fso = CreateObject("Scripting.FileSystemObject")
'create new file and add content
Set txs = fso.CreateTextFile(strFilePath, FILE_OVERWRITE)
txs.Write strContent
txs.Close
'clean up
Set txs = Nothing
Set fso = Nothing
End Sub

So if you have all your data in a database, you could use ADO to loop through a data query and FSO to create a page for each record. HTH.