473,385 Members | 1,742 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,385 software developers and data experts.

Viewing multiple ASP pages by using single ASP file

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??
Oct 20 '08 #1
1 1663
danp129
323 Expert 256MB
Not sure what you're looking for but i'll take a guess...

When you see a page that the filename doesn't change but it can show many different products based on the query string (product.asp?prod_id=###) that means it is a dynamic page that pulls information out of something, typically a database, such as access, mysql, mssql, etc, but sometimes a text file such as CSV or XML or XLS. Microsoft Access and Microsoft SQL Server are the most common database people use with ASP.

NOT RECOMMENDED, but if there are very few products (10 or so), you might just use FSO to read the contents of a static html file. This method could be used to buy time before switching to database driven website. FSO method would look something like this:

Expand|Select|Wrap|Line Numbers
  1. <%
  2. Dim ofs, ofile
  3. dim prod_id : prod_id=request.querystring("prod_id")
  4. select case prod_id
  5.   case 1
  6.     sFileName="product1.html"
  7.   case 2
  8.     sFileName="product2.html"
  9.   case 3
  10.     sFileName="product3.html"
  11.   case else
  12.     'load product1 by default
  13.     sFileName="product1.html"
  14. end select
  15.  
  16. Set ofs=Server.CreateObject("Scripting.FileSystemObject")
  17. Set ofile=ofs.GetFile(server.MapPath(sFileName))
  18. Response.Write(ofile.ReadAll)
  19. ofile.close
  20. set ofile=nothing
  21. set ofs=nothing
  22.  
  23. %>
  24.  
Oct 20 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

16
by: noah | last post by:
Does PHP have a feature to associate Cookie sessions with a persistent database connection that will allow a single transaction across multiple HTTP requests? Here is how I imagine my process: I...
11
by: Ohaya | last post by:
Hi, I'm trying to understand a situation where ASP seems to be "blocking" of "queuing" requests. This is on a Win2K Advanced Server, with IIS5. I've seen some posts (e.g.,...
7
by: jsale | last post by:
I have made an ASP.NET web application that connects to SQL Server, reading and writing data using classes. I was recommended to use session objects to store the data per user, because each user...
3
by: Carl Johansen | last post by:
I have a big ASP website (used by several thousand car dealers) that is a collection of lots of small and medium-sized applications. Now I want to start adding ASP.NET applications to it. I have...
9
by: Graham | last post by:
I have been having some fun learning and using the new Controls and methods in .Net 2.0 which will make my life in the future easier and faster. Specifically the new databinding practises and...
0
by: genc ymeri | last post by:
Hi over there, Does the .Net20 framework provide library classes/drivers to convert multiple single tiff files into a single multi-pages file or should I use third party tools ? Genc.
2
by: Jack Li | last post by:
Hi, If I declare multiple namspaces, each in a separate file, how do I specify their path with the "using" directives? Say I have 2 namespaces and 1 main function, all in separate files such as...
6
by: Joseph Geretz | last post by:
I have the following class which I am serializing and passing back and forth between my Web Service application and the client. public class Token : SoapHeader { public string SID; public...
6
by: Bob Johnson | last post by:
I'm finally getting around to migrating a "big" ASP.NET 1.1 app to 2.0. I've been reading up on the differences and I'm NOT finding something I was lead to believe was the case a long time ago. I...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.