Including .htm files conditionally?

  • Thread starter Sten Westerback
  • Start date
S

Sten Westerback

Hi

I'm considering using .asp to implement a selective
inclusion of .htm files containing tables into a HTML
code sent to browser from IIS.

My question is if it is possible to make an .asp page
that depending on two variables passed in the query
(start-month and end-month) return to the browser a
page that includes only files with names within the
specified months?

Lets take it ones more: ;)
1. the .htm files are ready for use and named month01.htm (january) etc.
2. the user enters wanted months on a form in the browser
3. the .asp constructs HTML code that starts with some static html code,
inserts the table for the first month, then some other text such as
"February",
then the next month etc stopping with the month defined on the input
form.

Is this type of thing possible with .asp using some scripting language?
Or do i need my own IIS Extension for this too?

Also, is it possible to let a server side script analyze a file to extract
information from the table to calculate the sum of the values in all the
tables in each column?

Could the filtering and calculations be done "easily" with client scripting?

Rgds,
Sten
 
I

Igor Tandetnik

Sten Westerback said:
My question is if it is possible to make an .asp page
that depending on two variables passed in the query
(start-month and end-month) return to the browser a
page that includes only files with names within the
specified months?

Of course. Don't make them complete HTMLs, make them HTML fragments
(that is, no <html> or <body> tags, just the parts that they should
contribute to the body). Your ASP page will output the prolog (<html>,
<head> and <body> tags as appropriate), then read and Response.Write
only the files that you want to include, then output the epilog (such as
Also, is it possible to let a server side script analyze a file to extract
information from the table to calculate the sum of the values in all the
tables in each column?

Well, if the file has a good consistent structure (say, a CSV), VBScript
is good enough to write simple parsing in.
Could the filtering and calculations be done "easily" with client
scripting?

For the client to do it, you need to have the server send the data in a
parsable format. E.g. <script> tag that declares arrays, or an XML
island. But to do that, the server needs to parse the files anyway, so
it can just perform the calculations as well.
--
With best wishes,
Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top