ASP Include is not working.

Discussion in 'ASP General' started by Rodger, Aug 15, 2008.

  1. Rodger

    Rodger Guest

    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
     
    Rodger, Aug 15, 2008
    #1
    1. Advertising

  2. Rodger

    Evertjan. Guest

    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.

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
     
    Evertjan., Aug 15, 2008
    #2
    1. Advertising

  3. Rodger

    Rodger Guest

    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." <> wrote in message
    news:Xns9AFBA9EAE35F2eejj99@194.109.133.242...
    > 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.
    >
    > --
    > Evertjan.
    > The Netherlands.
    > (Please change the x'es to dots in my emailaddress)
     
    Rodger, Aug 15, 2008
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. darrel
    Replies:
    4
    Views:
    2,317
    Guadala Harry
    Nov 4, 2004
  2. naveeddil
    Replies:
    0
    Views:
    583
    naveeddil
    Jan 4, 2008
  3. Andreas Bogenberger
    Replies:
    3
    Views:
    941
    Andreas Bogenberger
    Feb 22, 2008
  4. Eric
    Replies:
    10
    Views:
    479
  5. Eric
    Replies:
    0
    Views:
    265
Loading...

Share This Page