| | |
View multiple pages using single file
Please support our ASP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: Jun 2008
Posts: 89
Reputation:
Solved Threads: 7
Hi,
I'm newbie in ASP. I am trying to view multiple pages by using a single file.
For example,
I have a few pages of product.asp (products.asp, products1.asp and so on). Now I want to create a single single (products.asp) but can view multiple pages.
Try to search through google but not even sure what to search for.
Help??
I'm newbie in ASP. I am trying to view multiple pages by using a single file.
For example,
I have a few pages of product.asp (products.asp, products1.asp and so on). Now I want to create a single single (products.asp) but can view multiple pages.
Try to search through google but not even sure what to search for.
Help??
•
•
Join Date: Feb 2007
Posts: 66
Reputation:
Solved Threads: 4
Hi,
There are different methods for using one file (product.asp) to display dynamic content.
One simple method is to select case based on the product ID sent to the page through the address: imagine you visit the page product.asp?product_id=1
Another method is to use SSI (Server Side Includes). You can include files based on the product ID retrieved from the querystring:
Based on this you can build a whole website, which is displayed in one page only!
Good luck, happy coding!
There are different methods for using one file (product.asp) to display dynamic content.
One simple method is to select case based on the product ID sent to the page through the address: imagine you visit the page product.asp?product_id=1
ASP Syntax (Toggle Plain Text)
Select Case Request.QueryString("product_id") Case 1 'CONTENT RELATED TO PRODUCT ONE Response.Write "Product 1" Case Else 'no product is selected Response.Write "<h3>Please select a product</h3>" Response.Write "<a href=""product.asp?product_id=1"">Product 1 </a>" End Select
Another method is to use SSI (Server Side Includes). You can include files based on the product ID retrieved from the querystring:
ASP Syntax (Toggle Plain Text)
Select Case Request.QueryString("product_ID") Case 1 %> <!-- #Include File = "product1.asp" --> <% Case 2 %> <!-- #Include File = "product2.asp" --> ... ... <% Case Else %> <!-- #Include File = "product_overview.asp" --> <% End Select %>
Based on this you can build a whole website, which is displayed in one page only!
Good luck, happy coding!
•
•
Join Date: Jun 2008
Posts: 89
Reputation:
Solved Threads: 7
Sorry Baradaran... Can you elaborate more on the first solution? Where should I put that? Is it in the <body> part? Where should i assign the value to product_id?
If I use the second solution means i still have to create multiple products.asp file? I see in the coding I still to include a few products.asp file right?
Thanks...
If I use the second solution means i still have to create multiple products.asp file? I see in the coding I still to include a few products.asp file right?
Thanks...
Last edited by raul15791; Nov 1st, 2008 at 12:24 pm.
•
•
Join Date: Aug 2008
Posts: 2
Reputation:
Solved Threads: 1
hi!, what you need to do is use a database this will make things much easier to manage and will save page space. need with setting up a database driven page website ask me.
![]() |
Similar Threads
- Problems with browser compatibility.. especially internet explorer (JavaScript / DHTML / AJAX)
- fstream Tutorial (C++)
- Open In New Window Php (PHP)
- "Forbidden / You don't have permission to access / on this server." error (Linux Servers and Apache)
- Database class use (PHP)
- This Should be Easy for You Guys! (Linux Servers and Apache)
- Browser Battle -- Your TOP Pick! (Geeks' Lounge)
Other Threads in the ASP Forum
- Previous Thread: sql help
- Next Thread: Funky enter key behavior
| Thread Tools | Search this Thread |
archive asp asp.net aspandmssqlserver2005 aspandmssqlserver2005connection aspconnection connection database databaseconnection diagnostics dreamweaver excel fso iis microsoft msmsql mssql2005 mssqlserver2005 mssqlserver2005andasp mssqlserverandasp opentextfile record searchbox selectoption server single specfic sqlserver sqlserverconnection toolkit webserver windows7





