OK my day is ruined ;-)
In coldfusion this is something simple and used on a daily basis.
I will try the work around if its not disabled.
request.queryString( "method" ) would give me the url parameter right?
Main Topics
Browse All Topicshow do I include another page ASP/VBScript
what is the syntax?
I want to pass a parameter via the url and based upon that do a case statement to include the file
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
PS. any ideas on this one?
http://www.experts-exchang
OK I get
Error Type:
Active Server Pages, ASP 0141 (0x80004005)
The @ command can only be used once within the Active Server Page.
And I removed the @ command from the included file, but it seems to include not the first page but the second one as well, which is the one I have not removed it from.
<%@ Language=VBScript %>
<%
Select Case request.queryString( "method" )
Case "getContactInfo" %>
<!--#include file="getContactInfoXML.as
<% Case "accountBalance" %>
<!--#include file="accountBalanceXML.as
<% Case "registerDomain" %>
<!--#include file="registerDomainXML.as
<% End Select %>
It just seems to want to execute all include when I have
<%@ Language=VBScript %>
<%
Select Case request.queryString( "method" )
Case "getContactInfo" %>
<!--#include file="getContactInfoXML.as
<% Case "accountBalance" %>
<!--#include file="accountBalanceXML.as
<% Case "registerDomain" %>
<!--#include file="registerDomainXML.as
<% End Select %>
but when I have
<%
Select Case request.queryString( "method" )
Case "getContactInfo" %>
<!--#include file="getContactInfoXML.as
<% End Select %>
it works fine, any ideas?
1. when is <%%> necessary empty like that? (I'm new to ASP)
2. they are in the same folder
I had all of them removed but then I got:
Error Type:
Microsoft VBScript compilation (0x800A0411)
Name redefined
/com_startregistration/asp
Dim startupResult, Srs
------------------^
The files to be included must enclose all asp commands with <% and %>.
All files in the case statement are always included, but only the code that is in the true Case statement is executed.
The syntax is
<!--#include files="relative path to file"-->
or
<!--#include virtual="absolute path to file starting with /"-->
For example, if your script is called connection.asp, and is in a folder called /scripts, and the includes are in a folder called /includes, you could use this:
<!--#include files="../includes/connect
or
<!--#include virtual="/includes/connect
In the first case, "parent folders" has to be enabled on the server or you get and error because of the ".."
Also, it's recommended that all includes have a .asp extension, as sometime the webserver will display the source code to the clients browser, which can be a security risk.
Hope this helps
In relation to the script error (variable redefined).
If you define a variable in an include file (with the Dim command), you cannot redifine it again in another include. In this case, I would recommend that variables you share across includes be defined in one place (maybe a separate include, with just the variable definitions).
Hello Tacobell777
<%%> is necessary when you waht something to be done at server side like
on item 1
<%
Response.Rite("Heelo World");
%>
on item 2
Included files must start with <% and end with %> if there are code different than HTML tags.
You could try to incluse a single file with a simple contents like the above to see what's happens.
You cannot use switch to trigger which file to include. Use instead Server.Execute("myFileName
HTH
I
I know what <%%> is for, I just thought that he meant I needed to include <%%> literally.
> In relation to the script error
As I thought initially - it executes/parses all include files even though they are in different case statements, because none of the files give an error on its own.
I guess I am going to have to steer away from this include idea, it's to much of a hassle..
No comment has been added to this question in more than 21 days, so it is now classified as abandoned..
I will leave the following recommendation for this question in the Cleanup topic area:
Split points: NicksonKoh,ivostoykov,sams
Any objections should be posted here in the next 4 days. After that time, the question will be closed.
YZlat
EE Cleanup Volunteer
Business Accounts
Answer for Membership
by: NicksonKohPosted on 2005-10-25 at 23:45:55ID: 15160219
Hi Tacobell777,
com/webtec h/080199-1 .3.shtml.
What you are asking for is dynamic include. No ASP cannot truely do that but there is a walkaround shown at http://www.4guysfromrolla.
Cheers
Nickson