Connecting Tech Pros Worldwide Forums | Help | Site Map

ASP Include is not working.

Rodger
Guest
 
Posts: n/a
#1: Aug 15 '08
All,

I am looking to re-work my main page and have been using include statements on it and I now want to add another section, but this time my include is ASP. If I pull the ASP up by itself it works just fine. How ever when I have it in my default.htm page the ASP does not execute so when I look at the source I see all the ASP Code. any idea what I need to set?

Here is the code in my main page for the include.

<P align=CENTER style="FONT-FAMILY: Tahoma"><!--#include file="public/nursing.htm"--></P><hr />

<!--#include file="public/MENU.asp"--></td>

MENU.asp - works if I type it in the address bar, but when I have it in my include it does not work.

MENU.ASP

<%@ Language=VBScript %>

<% Option Explicit %>

<% Response.Buffer = true %>

<%

Dim conn, rs, rs2, mySQL, mySQL2, dbPath, myDate


Set Conn = Server.CreateObject("ADODB.Connection")

conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\intranet\protected\bethesda.mdb" ';User Id=admin;Password="

conn.Properties("Jet OLEDB:Max Buffer Size") = 256

mySQL = "SELECT * FROM MENUS WHERE MEN_ID=1"

set rs = conn.Execute(mySQL)


myDate = rs("MEN_DATE")

%>

<html>

<head>

<title>Menu Page</title>

</head>

<body>

<table align='center'>

<tr align=center >

<td><span style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">

<%Response.write FormatDateTime(myDate,1)%><br />

Dinnig Room Menu<BR /><BR />

Starters<BR />

<span style=color=<%=rs("MEN_SOUP1_COLOR")%>><%=rs("MEN_ SOUP1")%></span>

<% if rs("MEN_SOUP1_V") = "on" Then %><IMG SRC="../images/icon_vegetarian.gif" /><%end if %>

<% if rs("MEN_SOUP1_HC") = "on" Then %><IMG SRC="../images/icon_lowfat.gif" /><%end if %<br />

<span style=color=<%=rs("MEN_SOUP2_COLOR")%>><%=rs("MEN_ SOUP2")%></span>

<% if rs("MEN_SOUP2_V") = "on" Then %><IMG SRC="../images/icon_vegetarian.gif" /><%end if %>

<% if rs("MEN_SOUP2_HC") = "on" Then %><IMG SRC="../images/icon_lowfat.gif" /><%end if %<br /><br />

Entrees<br />

<span style=color=<%=rs("MEN_ENTREE1_COLOR")%>><%=rs("ME N_ENTREE1")%></span>

<% if rs("MEN_ENTREE1_V") = "on" Then %><IMG SRC="../images/icon_vegetarian.gif" /><%end if %>

<% if rs("MEN_ENTREE1_HC") = "on" Then %><IMG SRC="../images/icon_lowfat.gif" /><%end if %<br /

<span style=color=<%=rs("MEN_ENTREE2_COLOR")%>><%=rs("ME N_ENTREE2")%></span>

<% if rs("MEN_ENTREE2_V") = "on" Then %><IMG SRC="../images/icon_vegetarian.gif" /><%end if %>

<% if rs("MEN_ENTREE2_HC") = "on" Then %><IMG SRC="../images/icon_lowfat.gif" /><%end if %<br /

<span style=color=<%=rs("MEN_ENTREE3_COLOR")%>><%=rs("ME N_ENTREE3")%></span>

<% if rs("MEN_ENTREE3_V") = "on" Then %><IMG SRC="../images/icon_vegetarian.gif" /><%end if %>

<% if rs("MEN_ENTREE3_HC") = "on" Then %><IMG SRC="../images/icon_lowfat.gif" /><%end if %<br /

Vegetables<br />

<span style=color=<%=rs("MEN_VEG1_COLOR")%>><%=rs("MEN_V EG1")%></span>

<% if rs("MEN_VEG1_V") = "on" Then %><IMG SRC="../images/icon_vegetarian.gif" /><%end if %>

<% if rs("MEN_VEG1_HC") = "on" Then %><IMG SRC="../images/icon_lowfat.gif" /><%end if %<br /

<span style=color=<%=rs("MEN_VEG2_COLOR")%>><%=rs("MEN_V EG2")%></span>

<% if rs("MEN_VEG2_V") = "on" Then %><IMG SRC="../images/icon_vegetarian.gif" /><%end if %>

<% if rs("MEN_VEG2_HC") = "on" Then %><IMG SRC="../images/icon_lowfat.gif" /><%end if %<br /

<span style=color=<%=rs("MEN_VEG3_COLOR")%>><%=rs("MEN_V EG3")%></span>

<% if rs("MEN_VEG3_V") = "on" Then %><IMG SRC="../images/icon_vegetarian.gif" /><%end if %>

<% if rs("MEN_VEG3_HC") = "on" Then %><IMG SRC="../images/icon_lowfat.gif" /><%end if %<br /

<span style=color=<%=rs("MEN_VEG4_COLOR")%>><%=rs("MEN_V EG4")%></span>

<% if rs("MEN_VEG4_V") = "on" Then %><IMG SRC="../images/icon_vegetarian.gif" /><%end if %>

<% if rs("MEN_VEG4_HC") = "on" Then %><IMG SRC="../images/icon_lowfat.gif" /><%end if %<br />

Assorted Fresh Fruit<br />

Garden Salads<br /><br />

Grab and Go<br />

<span style=color=<%=rs("MEN_GRAB_GO_COLOR")%>><%=rs("ME N_GRAB_GO")%></span>

<% if rs("MEN_GRAB_GO_V") = "on" Then %><IMG SRC="../images/icon_vegetarian.gif" /><%end if %>

<% if rs("MEN_GRAB_GO_HC") = "on" Then %><IMG SRC="../images/icon_lowfat.gif" /><%end if %<br /><br />

Grill Special<br />

<span style=color=<%=rs("MEN_GRILL_COLOR")%>><%=rs("MEN_ GRILL")%></span>

<% if rs("MEN_GRILL_V") = "on" Then %><IMG SRC="../images/icon_vegetarian.gif" /><%end if %>

<% if rs("MEN_GRILL_HC") = "on" Then %><IMG SRC="../images/icon_lowfat.gif" /><%end if %<br /><br /></span>

</td>

</tr>

</table>

</body>

</html>



Thanks,
Rodger


Evertjan.
Guest
 
Posts: n/a
#2: Aug 15 '08

re: ASP Include is not working.


Rodger wrote on 15 aug 2008 in microsoft.public.inetserver.asp.general:
Quote:
>
I am looking to re-work my main page and have been using include
statements on it and I now want to add another section, but this time
my include is ASP. If I pull the ASP up by itself it works just fine.
How ever when I have it in my default.htm page the ASP does not
execute so when I look at the source I see all the ASP Code. any idea
what I need to set?
>
Here is the code in my main page for the include.
>
<P align=CENTER style="FONT-FAMILY: Tahoma"><!--#include
file="public/nursing.htm"--></P><hr />
>
<!--#include file="public/MENU.asp"--></td>
>
MENU.asp - works if I type it in the address bar, but when I have it
in my include it does not work.
MENU.asp is not executed as an asp page,
but,
and that is what include is supposed to do,
the source is just inserted as a text string.
so,
if the mail page is main.htm, there is no ASP rendering.

Read up on ASP include specs.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Rodger
Guest
 
Posts: n/a
#3: Aug 15 '08

re: ASP Include is not working.


Thanks, I am not sure where my head was . . . . . I even wrote that it was
in my default.htm Works great when I do it right!


"Evertjan." <exjxw.hannivoort@interxnl.netwrote in message
news:Xns9AFBA9EAE35F2eejj99@194.109.133.242...
Quote:
Rodger wrote on 15 aug 2008 in microsoft.public.inetserver.asp.general:
>
Quote:

I am looking to re-work my main page and have been using include
statements on it and I now want to add another section, but this time
my include is ASP. If I pull the ASP up by itself it works just fine.
How ever when I have it in my default.htm page the ASP does not
execute so when I look at the source I see all the ASP Code. any idea
what I need to set?

Here is the code in my main page for the include.

<P align=CENTER style="FONT-FAMILY: Tahoma"><!--#include
file="public/nursing.htm"--></P><hr />

<!--#include file="public/MENU.asp"--></td>

MENU.asp - works if I type it in the address bar, but when I have it
in my include it does not work.
>
MENU.asp is not executed as an asp page,
but,
and that is what include is supposed to do,
the source is just inserted as a text string.
so,
if the mail page is main.htm, there is no ASP rendering.
>
Read up on ASP include specs.
>
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Closed Thread