navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

Microsoft MVP

 

Include question

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> Include question
Page: [1]
 
wizard_oz

 

Posts: 140
Joined: 9/3/2004
From: Ga,USA
Status: offline

 
Include question - 11/7/2006 7:44:14   
Hi everyone
I have a code in asp and I would like to call to the file with a certain variable for example
<%
	if choose=1 then
	%>
	<!-- #include file="../Template/FloorTemplate.asp"-->
	<%
	else
	%>
	<!-- #include file="../Template/SportTemplate.asp"-->
	<%
	end if
	%>

I would like to do <!-- #include file="../Template/FloorTemplate.asp?id=1"-->
but this is not working, How can I make it work?
Thanks, Elen
Spooky

 

Posts: 26599
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Include question - 11/7/2006 15:00:21   
This should work for you?

<%
	if choose=1 then
	%>
	<!-- #include virtual="/Template/FloorTemplate.asp?id=1"-->
	<%
	else
	%>
	<!-- #include virtual="/Template/SportTemplate.asp"-->
	<%
	end if
	%>


_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to wizard_oz)
wizard_oz

 

Posts: 140
Joined: 9/3/2004
From: Ga,USA
Status: offline

 
RE: Include question - 11/8/2006 6:37:18   
Hi Spooky
Thanks for your reply. I tried this code but it keeps telling me that "The include file 'test.asp?id=1' was not found "
any idea?

(in reply to Spooky)
Spooky

 

Posts: 26599
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Include question - 11/8/2006 13:28:26   
Can you explain a little further what you need to do? I was thinking of something else :)

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to wizard_oz)
wizard_oz

 

Posts: 140
Joined: 9/3/2004
From: Ga,USA
Status: offline

 
RE: Include question - 11/9/2006 5:11:15   
Ok, the first page is menu page with 2 item and every menu add an ASP file wuch include some commands for example this is my first code and it's working fine
<%
	choose=Request.QueryString("choose")
	Application("LogoSport")="SPORT"
	Application("LogoFloor")="FLOOR"
	id=1
%>
<body>
<table width="765" border="0" align="right" cellpadding="0" cellspacing="0">
  <tr>
	<td colspan="2">
	<%
	if choose=1 then
	%>
	<!-- #include file="../Template/FloorTemplate.asp"-->
	<%
	else
	%>
	<!-- #include file="../Template/SportTemplate.asp"-->
	<%
	end if
	%>
 </td> </tr>
	<tr><td width="645"> </td>
		<td width="120" height="700" bgcolor="#666666" valign="top" align="right"> 
		<font face='arial' size=6><p align=center>
	<%
	if choose=1 then
		Response.Write Application("LogoFloor")
	else
		Response.Write Application("LogoSport")
	end if
	%>
	</p></font>
		
		</td>
	</tr>
</table>

the lines:
<!-- #include file="../Template/FloorTemplate.asp"-->
<!-- #include file="../Template/SportTemplate.asp"-->
are the same the only diffrents between them is the query, if I could make a coomand line like that:
<!-- #include file="../Template/FloorTemplate.asp?id=1"--> it will solve my problem becuase now I need to add more items to the menu file which means I will have 4 item in the menu file

Thanks,Elen

(in reply to Spooky)
Spooky

 

Posts: 26599
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Include question - 11/14/2006 14:25:57   
If the include files are the same (except the query) I would be coding them within the page and not using an include.
Then, the only difference would be the query.
With includes, both files are included (used or not) so it also saves resources if just the required code is changed

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to wizard_oz)
wizard_oz

 

Posts: 140
Joined: 9/3/2004
From: Ga,USA
Status: offline

 
RE: Include question - 11/15/2006 11:20:23   
Hi, the solution is good but I have a problem with that, Now I will need to change all my files.
With my idea I create one file and I call him with all the other file (10 files)
Do you have any other idea for me?

(in reply to Spooky)
wizard_oz

 

Posts: 140
Joined: 9/3/2004
From: Ga,USA
Status: offline

 
RE: Include question - 11/20/2006 15:12:59   
anyone?

(in reply to wizard_oz)
Spooky

 

Posts: 26599
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Include question - 11/20/2006 16:10:53   
Still not quite clear - if you have an include file such as
<!-- #include file="../Template/FloorTemplate.asp"-->

As you have already declared that id=1 prior to that include, then all code in that include can access "ID" as a variable?
Im not too sure what you mean when referring to the menu

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to wizard_oz)
wizard_oz

 

Posts: 140
Joined: 9/3/2004
From: Ga,USA
Status: offline

 
RE: Include question - 11/21/2006 5:05:03   
Ok, let's say I'm calling to the file like that
if choose=1 then
<!-- #include file="../Template/FloorTemplate.asp"-->
else
<!-- #include file="../Template/SportTemplate.asp"-->
end if

but those files are the same file. the only diffrents between them is the variable of the CATEGORY in the query and it look like this:
sql="select * from RightMenu where category=2 and ShowMenu=on order by Priority"
I would like to do:
sql="select * from RightMenu where category=" & id & " and ShowMenu=on order by Priority"

Elen

(in reply to Spooky)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> Include question
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts