473,385 Members | 1,983 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.

Include file with param

TNG
Hi,

I try to accomplish something like this:

<!--#include file="menu_<%response.write (strproduct)%>.html"-->

But unfortunally, I quess there is something with my syntax... any idea ?
Jul 22 '05 #1
3 1570
Gazing into my crystal ball I observed "TNG" <TN*@group.com> writing in
news:SU**********************@phobos.telenet-ops.be:
Hi,

I try to accomplish something like this:

<!--#include file="menu_<%response.write (strproduct)%>.html"-->

But unfortunally, I quess there is something with my syntax... any idea
?


The include is processed before ASP code is processed, and therefore does
not have access to any variables.

What you might want to do is something like:

<% select case request.querystring("page")
case "apples"%>
<!--#include file="menu_apples.html"-->
<% case "oranges"%>
<!--#include file="menu_oranges.html"-->
<% case else%>
<!--#include file="menu_default.html"-->
<% end select%>

--
Adrienne Boswell
http://www.cavalcade-of-coding.info
Please respond to the group so others can share
Jul 22 '05 #2
"TNG" wrote in message
news:SU**********************@phobos.telenet-ops.be...
: I try to accomplish something like this:
:
: <!--#include file="menu_<%response.write (strproduct)%>.html"-->
:
: But unfortunally, I quess there is something with my syntax... any idea ?

The include file executes for the ASP processor. The only way I know to use
an include file dynamically is to use server.execute.

I have an example:

Run this alone and it will report it's virtual path:
http://kiddanger.com/lab/serverdotexec.asp

Run it with ?q=a, ?q=b or ?q=c and it will also include the appropriate
file.

Here's the code:
<%@ Language=VBScript %>
<%
Option Explicit
Response.Buffer = True

dim q
q =
server.HTMLEncode(replace(replace(replace(Request. QueryString("q"),"'","''"),";",""),"--",""))

Response.Write Request.ServerVariables("SCRIPT_NAME") & "<br />" & vbCrLf

if q <> "" Then
select case q
case "a"
server.execute "/lab/serverdotexeca.asp"
case "b"
server.execute "/lab/serverdotexecb.asp"
case "c"
server.execute "/lab/serverdotexecc.asp"
case else
Response.Write "Nice try!"
Response.End
end select
end if
%>

This is serverdotexeca.asp. b and c are similar.

<%@ Language=VBScript %>
<%
Option Explicit
Response.Buffer = True
Response.Write "This is serverdotexeca.asp<br />" & vbCrLf
%>

HTH...

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
Jul 22 '05 #3
TNG
Thx
"Adrienne" <ar********@sbcglobal.net> wrote in message
news:Xn****************************@207.115.63.158 ...
Gazing into my crystal ball I observed "TNG" <TN*@group.com> writing in
news:SU**********************@phobos.telenet-ops.be:
Hi,

I try to accomplish something like this:

<!--#include file="menu_<%response.write (strproduct)%>.html"-->

But unfortunally, I quess there is something with my syntax... any idea
?


The include is processed before ASP code is processed, and therefore does
not have access to any variables.

What you might want to do is something like:

<% select case request.querystring("page")
case "apples"%>
<!--#include file="menu_apples.html"-->
<% case "oranges"%>
<!--#include file="menu_oranges.html"-->
<% case else%>
<!--#include file="menu_default.html"-->
<% end select%>

--
Adrienne Boswell
http://www.cavalcade-of-coding.info
Please respond to the group so others can share

Jul 22 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Marc Ferry | last post by:
I already posted this mail in comp.sys.hp and comp.sys.hp.hpux but had no response. As this problem might be present on other OSes than HP-UX 10.20, I crosspost it here, in the hope of getting an...
2
by: Ronald Meier | last post by:
Hi I'm using VC++ 6.0 SP5 under windows 2k. I tried to compile the net-snmp (sourceforge.net) source. When I try to compile, I get the following errors (missings): Cannot open include file:...
5
by: Kenneth | last post by:
Can anyone explain me why it is neccesary to include SqlDbType to the SqlParameter. In every example I see, it is done, but no one explaines why. I have for example a date I want to save into my...
2
by: Richard L Rosenheim | last post by:
Is it possible to include addition tags in a XSLT file, that the XSLT processor will, for all practical purposes, ignore? What I'm looking to do is to include a section to contain information...
0
by: Andrew Dowding | last post by:
Hi Everybody, I have been looking at problems with my Windows Forms C# application and it's little Jet 4 (Access) database for the last few days. The Windows Forms app implements a facade and...
1
by: Zbigniew | last post by:
Hi, Compiler: GCC 3.3.5 OS: SuSE Linux (Kernel: 2.6.11) I reorganized my source code and now almost all my header files went to "Include" folder. Now when compiling with -I option I have...
19
by: Lee Crabtree | last post by:
Is there a class in the framework that allows me read text from a file in an unbuffered manner? That is, I'd like to be able to read lines in the same manner as StreamReader.ReadLine(), but I also...
4
by: MikeJ | last post by:
make a While loop ofs = TextFileServer("somefile") string srow while (ofs=false) { srow=ofs.getRow(); Console.Writeline(srow); }
5
by: ShadowLocke | last post by:
This class makes use of System.Collections.Hashtable to enumerate all the settings in an INI file for easy access. Its very simplistic, and completely re-useable. Solid addition for any app that...
3
by: Simon Brooke | last post by:
I'm trying to do internationalisation by using xsl:include to include a different file depending on the locale setting, and I'm completely failing. I've tried several different approaches: ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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.