|
| |
|
|
wizard_oz
Posts: 158 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
|
|
|
|
wizard_oz
Posts: 158 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?
|
|
|
|
wizard_oz
Posts: 158 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
|
|
|
|
wizard_oz
Posts: 158 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?
|
|
|
|
wizard_oz
Posts: 158 Joined: 9/3/2004 From: Ga,USA Status: offline
|
RE: Include question - 11/20/2006 15:12:59
anyone?
|
|
|
|
wizard_oz
Posts: 158 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
|
|
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
|
|
|