ASP Include is not working.

R

Rodger

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("MEN_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("MEN_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("MEN_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_VEG1")%></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_VEG2")%></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_VEG3")%></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_VEG4")%></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("MEN_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
 
E

Evertjan.

Rodger wrote on 15 aug 2008 in microsoft.public.inetserver.asp.general:
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.
 
R

Rodger

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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,968
Messages
2,570,153
Members
46,699
Latest member
AnneRosen

Latest Threads

Top