<% @LANGUAGE = VBScript %> <% Option Explicit %>
must always be the 1st line on the page above <html>
But DWT's will not propogate anything outside of the <head> tags or </body> tags
- a knows bug of DWTs
--
_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
_____________________________________________
| Ron - it gives me the same error...
| Here is all the code. The asp bit is in the last <tr> of the table:
|
| <html>
|
| <head>
| <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
| <link rel="stylesheet" type="text/css"
| href="file:///C:/Inetpub/wwwroot/inserts/style.css">
| <link rel="stylesheet" type="text/css"
| href="file:///C:/Inetpub/wwwroot/inserts/style2.css">
| <link rel="stylesheet" type="text/css"
| href="file:///C:/Inetpub/wwwroot/inserts/CascadeMenu.css">
| <script language="javascript"
| src="file:///C:/Inetpub/wwwroot/inserts/CascadeMenu.js"></script>
| <!-- #BeginEditable "doctitle" -->
| <title>Logged in User</title>
| <!-- #EndEditable -->
| <% @LANGUAGE = VBScript %> <% Option Explicit %>
| <!-- #include virtual="/Inserts/ADOVBS.INC" --><%
| Dim objCmd, objRS, objParam, objConn
|
| Set objConn = Server.CreateObject("ADODB.Connection")
| objConn.ConnectionString = session("strConnection")
| objConn.CursorLocation = adUseClient
| objConn.Open
|
| Set objCmd = Server.CreateObject("ADODB.Command")
| Set objCmd.ActiveConnection = objConn
| objCmd.CommandText = "sp_Get_Logged_In_Employee"
| objCmd.CommandType = adCmdStoredProc
|
| Set objRS = objCmd.Execute
|
| %>
| </head>
|
| <body>
|
| <table border="0" cellpadding="0" cellspacing="0" width="100%">
| <!-- MSTableType="layout" -->
| <tr>
| <td valign="top" colspan="2">
| <!-- MSCellType="ContentHead" -->
| <!--webbot bot="Include" U-Include="Inserts/TopMenuNewTest5.htm"
| TAG="BODY" --> </td>
| </tr>
| <tr>
| <td msopnltype="NavBody" rowspan="2" width="200" valign="top">
| <!-- MSCellType="NavBody" -->
| <!-- #BeginEditable "LeftMenu" -->
| <!--webbot bot="Include" U-Include="Inserts/MainMenu.htm" TAG="BODY"
| --> <!-- #EndEditable --></td>
| <td valign="top">
| <!-- MSCellType="ContentBody" -->
| <!-- #BeginEditable "Contents" -->
| <!--webbot bot="Include" U-Include="Inserts/HomePage_new.htm" TAG="BODY"
| --> <!-- #EndEditable --></td>
| </tr>
| <tr>
| <td valign="top">
| <!-- MSCellType="ContentFoot" -->
| <table class="noprint" style="font-size: 8pt; border-collapse:collapse;
| text-align:center" width="100%" border="0" bordercolor="#FFFFFF"
| background="../images/Nedbank_Images/barFiller.jpg">
| <%Do while not objRS.eof%>
| <tr>
| <td width="50%" style="font-family: Verdana; color: #627368"><font
| size="1">Logged in User: <%=objRS("StaffName") & " " & "(" &
| objRS("StaffNum") & ")"%></font></td>
| <td width="10%" align="center">
| </td>
| <td width="10%" align="center">
| <a title="Send e-mail to the webmaster" class="banneranchor"
| href="mailto:
[email protected]?subject=CardZone Website"><font size="1">
| Web Administrator</font></a></td>
| <td width="10%" align="center"><a class="banneranchor"
| href="disclaimer.htm" target="main"><font size="1">Disclaimer</font></a></td>
| </tr>
| <%objRS.MoveNext
| Loop%>
| </table>
| </td>
| </tr>
| </table>
|
| </body>
|
| </html>
| --
| MkS
|
|
| "Ronx" wrote:
|
| > Q1 - Could you post the first dozen lines from your page that gives
| > the error? Change anything that may be a security breach.
| > Try using <% Option Explicit %> instead of <%Option Explicit%>
| >
| > Q2 - The ADOVBS.INC file can be left where it is.
| >
| > Change <!-- #include file="ADOVBS.INC --> to
| > <!-- #include virtual="/subfolder/ADOVBS>INC" --> where subfolder is
| > the name of the subfolder. Notice the / before the subfolder name.
| > This will work with all your pages, no matter which folder they are in,
| > so you only have the single copy of ADOVBS.INC to edit.
| >
| >
| >
| > --
| > Ron Symonds - Microsoft MVP (Expression)
| > Reply only to group - emails will be deleted unread.
| >
| >
http://www.rxs-enterprises.org/fp
| >
| >
| >
| >
| > | >
| > > As you can probably tell, dwts wasn't really covered in the FP course I did
| > >
. Thx for explaining how it all works!
| > >
| > > Q1: I did it step by step, and it gives me the 'Page cannot be displayed'
| > > error:
| > > Error Type:
| > > Microsoft VBScript compilation (0x800A0400)
| > > Expected statement
| > > /Inserts/newdefault2xtest.asp, line 6
| > > Option Explicit
| > >
| > > (to test it I've moved all the files into the same folder)
| > >
| > > Q2: I understand that the asp footer file ADOVBS.INC needs to be located in
| > > the same folder as the dwt and all the pages, as it is an include file and
| > > can only be called up from the same folder. Currently for our intranet, the
| > > 'default homepage' (the old frames based one) lie in my wwwroot folder, and
| > > the included pages (top header, menu etc) are in a subfolder of the root.
| > > ADOVBS.INC is also in the subfolder, so to get the new site to work (with the
| > > dwt pages instead of frames) I would have to move ADOVBS.INC to the root
| > > folder? The other included files (header/menu) seem to work fine from the
| > > subfolder?
| > >
| > > Our other pages for our intranet are located in about 15 different
| > > subfolders - does that mean that if I wanted to always include the asp footer
| > > in each page, I would have to have a ADOVBS.INC in each of the folders? and
| > > then if something changes in the inc file it would have to be changed in each
| > > one?
| > >
| > > I'm thinking that I should just do away with the asp footer and convince the
| > > boss we won't need that info...
| > > --
| > > MkS
| > >
| > >
| > > "Ronx" wrote:
| > >
| > > > Open the DWT and copy the code immediately after the <head> tag, so you
| > > > get:
| > > > <head>
| > > > <% @Language = VBScript %>
| > > > <%Option Explicit%>
| > > > <!-- #include file="ADOVBS.INC" -->
| > > > <%
| > > > Dim objCmd, objRS, objParam, objConn
| > > > Set objConn = Server.CreateObject("ADODB.Connection")
| > > > objConn.ConnectionString = session("strConnection")
| > > > objConn.CursorLocation = adUseClient objConn.Open
| > > > Set objCmd = Server.CreateObject("ADODB.Command")
| > > > Set objCmd.ActiveConnection = objConn
| > > > objCmd.CommandText = "sp_Get_Logged_In_Employee"
| > > > objCmd.CommandType = adCmdStoredProc
| > > > Set objRS = objCmd.Execute
| > > > %>
| > > >
| > > >
| > > > This requires that the file ADOVBS.INC is in the same folder as your
| > > > pages, and all your pages are in that folder.
| > > >
| > > > Save the DWT as a .dwt file. The DWT will never run on the server - it
| > > > forms a template for your real pages. These must be saved as .asp
| > > > files.
| > > >
| > > > To test, create a new page based on the DWT:
| > > >
| > > > Click the new page icon and immediately save (but don't close) the blank
| > > > page. Make sure the extension is .asp.
| > > >
| > > > Use Format->Dynamic Web Template->Attach Dynamic Web Template
| > > > Browse to and select your DWT. Click Open
| > > >
| > > > After the page has been formatted notice that the asp code is in place.
| > > > Publish to your server and test. Make sure ADOVBS.INC is also on the
| > > > server in the same folder. I suggest adding the line
| > > > <%= "<p>Hello World</p>" %>
| > > > somewhere in the content editable region to prove the asp is being
| > > > processed.
| > > > --
| > > > Ron Symonds - Microsoft MVP (Expression)
| > > > Reply only to group - emails will be deleted unread.
| > > >
| > > >
http://www.rxs-enterprises.org/fp
| > > >
| > > >
| > > >
| > > >
| > > > | > > >
| > > > > Thx so much Ron! I've set up the whole page, and followed your directions on
| > > > > sample.asp to include the asp footer. It's not working, so 2 Q's:
| > > > >
| > > > > 1. This is the code that appeared in the original asp, before <head> (above
| > > > > <html>):
| > > > > <% @LANGUAGE = VBScript %> <%Option Explicit%>
| > > > > <!-- #include file="ADOVBS.INC" --><%
| > > > > Dim objCmd, objRS, objParam, objConn
| > > > > Set objConn = Server.CreateObject("ADODB.Connection")
| > > > > objConn.ConnectionString = session("strConnection")
| > > > > objConn.CursorLocation = adUseClient
| > > > > objConn.Open
| > > > > Set objCmd = Server.CreateObject("ADODB.Command")
| > > > > Set objCmd.ActiveConnection = objConn
| > > > > objCmd.CommandText = "sp_Get_Logged_In_Employee"
| > > > > objCmd.CommandType = adCmdStoredProc
| > > > > Set objRS = objCmd.Execute
| > > > > %>
| > > > >
| > > > > Do I copy this code into the <head> of the dwt or before the <html> as it
| > > > > was in the original asp? I've basically tried both, but can't get it to
| > > > > work.. not sure what I'm doing wrong...
| > > > >
| > > > > 2. and When the dwt is ready, do I save it as a htm or asp in order to get
| > > > > the footer to display correctly when testing on the server?
| > > > >
| > > > > --
| > > > > MkS
| > > > >
| > > > >
| > > > > "Ronx" wrote:
| > > > >
| > > > > > Start a new page with the layout you need and save as a DWT.
| > > > > >
| > > > > > Make editable regions.
| > > > > >
| > > > > > Make pages for navigation, footer etc. and include them where required.
| > > > > > These pages MUST be .htm or .html, or the FrontPage include will not
| > > > > > work. If the navigation is not likely to change, then place the
| > > > > > navigation directly into the DWT, if it is likely to change - use an
| > > > > > Include file. You can include FP includes in a DWT in the same way as
| > > > > > they are included in ordinary pages.
| > > > > >
| > > > > > Copy the footer from the asp page into the footer area of the DWT. This
| > > > > > saves learning how to use SSI (also known as ASP includes).
| > > > > >
| > > > > > At
http://www.rxs-enterprises.org/tests/pages/dwt-sample.zip there is a
| > > > > > sample DWT, asp page and include file for you to look at. It should get
| > > > > > you started.
| > > > > > The asp page is also at
| > > > > >
http://www.rxs-enterprises.org/tests/pages/sample.asp for viewing from a
| > > > > > server.
| > > > > > --
| > > > > > Ron Symonds - Microsoft MVP (Expression)
| > > > > > Reply only to group - emails will be deleted unread.
| > > > > >
| > > > > >
http://www.rxs-enterprises.org/fp
| > > > > >
| > > > > >
| > > > > >
| > > > > > | > > > > >
| > > > > > > The asp footer needs to be on all pages, not just the homepage.
| > > > > > >
| > > > > > > So how would I start it all? :
| > > > > > > - Create a new page with layout tables and save as dwt.
| > > > > > > - Make editable regions in dwt
| > > > > > > - save seperate pages as asp (menus etc)
| > > > > > > - Include seperate pages in sections of my dwt (I thought I cannot do this?
| > > > > > > How does SSI work?)
| > > > > > > - save completed dwt as asp page?
| > > > > > > or if I only copy the code of the asp footer into the bottom cell of my
| > > > > > > table on the dwt, do i save the dwt as asp when i'm done?
| > > > > > >
| > > > > > > thx so much for your help so far....
| > > > > > >
| > > > > > > --
| > > > > > > MkS
| > > > > > >
| > > > > > >
| > > > > > > "Ronx" wrote:
| > > > > > >
| > > > > > > > A better option is to make all your pages asp pages. Depending on how
| > > > > > > > it is written the footer asp page can be included using Server Side
| > > > > > > > Includes, or you could just copy the code from the page into the footer
| > > > > > > > section of the DWT, or into an editable region in the Home page
| > > > > > > > (depending on how many pages the asp page has to go into.)
| > > > > > > >
| > > > > > > > If the asp is restricted to the Home page then an iFrame will probably
| > > > > > > > be the best solution - the asp footer will be the source for the iFrame.
| > > > > > > > Make an editable region in the DWT for the footer - the iFrame will go
| > > > > > > > into this region on the Home page, either with the common footer details
| > > > > > > > or replacing it. Other pages will get the common footer details in the
| > > > > > > > DWT.
| > > > > > > >
| > > > > > > > Post back if you need help on specific details.
| > > > > > > >
| > > > > > > > --
| > > > > > > > Ron Symonds - Microsoft MVP (Expression)
| > > > > > > > Reply only to group - emails will be deleted unread.
| > > > > > > >
| > > > > > > >
http://www.rxs-enterprises.org/fp
| > > > > > > >
| > > > > > > >
| > > > > > > >
| > > > > > > >
| > > > > > > > | > > > > > > >
| > > > > > > > > Ron - your post is extremely helpful! Thx so much! Think I've figured it out,
| > > > > > > > > gonna have to change a lot of pages (to include the dwt / header & menu
| > > > > > > > > panes) but once it's set up it should work.
| > > > > > > > >
| > > > > > > > > Now to make things more difficult for me, there is a footer that I need to
| > > > > > > > > add to my homepage... problem is, the footer is an asp page (it displays the
| > > > > > > > > name + employee number of the person who is logged in). I see I cannot add an
| > > > > > > > > asp into a table, only into a seperate frame. Does that mean I have to create
| > > > > > > > > one big frame containing the original layout table (based on dwt with header,
| > > > > > > > > left menu and content, includes etc), and another frame below with the asp
| > > > > > > > > page in? In other words my 'homepage' will call up the frames page, which
| > > > > > > > > will call up the layout table, which will call up the included pages? It
| > > > > > > > > seems that I will be creating a lot of extra pages for every click from the
| > > > > > > > > menu.... or is this the only option?
| > > > > > > > > --
| > > > > > > > > MkS
| > > > > > > > >
| > > > > > > > >
| > > > > > > > > "Ronx" wrote:
| > > > > > > > >
| > > > > > > > > > Question 1:
| > > > > > > > > > Six of one, half a dozen of the other.
| > > > > > > > > >
| > > > > > > > > > 1) You can use the existing header/top page as an include file and
| > > > > > > > > > include it into all pages. It is not necessary to place the include in
| > > > > > > > > > an editable region, unless you want different groups of pages to have
| > > > > > > > > > different menus.
| > > > > > > > > >
| > > > > > > > > > 2) You can use a DWT (which will incorporate your layout table) and add
| > > > > > > > > > the contents of the header/top page into the DWT.
| > > > > > > > > >
| > > > > > > > > > 3) As 2), but use the header/top page as an Include file in the DWT.
| > > > > > > > > >
| > > > > > > > > > My personal choice is to mix 2) and 3) - Use a DWT, and make the
| > > > > > > > > > navigation an included file, and the rest of the masthead as fixed
| > > > > > > > > > content.
| > > > > > > > > >
| > > > > > > > > >
| > > > > > > > > > Qustion 2:
| > > > > > > > > >
| > > > > > > > > > You don't. For this to happen you need either frames, an iFrame
| > > > > > > > > > (similar problems for the author and user as frames), or a lot of
| > > > > > > > > > JavaScript and hefty downloads.
| > > > > > > > > >
| > > > > > > > > > Each link will open a new page. Each page is based on the DWT which
| > > > > > > > > > already contains the menu, masthead etc.
| > > > > > > > > >
| > > > > > > > > > If it helps a copy of the DWT I used on some of my pages is at
| > > > > > > > > >
http://www.rxs-enterprises.org/dwt/site.htm
| > > > > > > > > > This uses include files for the top and left menus, and the footer.
| > > > > > > > > > Notice that the top menu is an include file, not in an editable region,
| > > > > > > > > > but the left menu is an include file placed in an editable region.
| > > > > > > > > > A page using this DWT is at
| > > > > > > > > >
http://www.rxs-enterprises.org/tests/email-check.htm - the left menu is
| > > > > > > > > > not the same as in the DWT.
| > > > > > > > > > --
| > > > > > > > > > Ron Symonds - Microsoft MVP (Expression)
| > > > > > > > > > Reply only to group - emails will be deleted unread.
| > > > > > > > > >
| > > > > > > > > >
http://www.rxs-enterprises.org/fp
| > > > > > > > > >
| > > > > > > > > >
| > > > > > > > > >
| > > > > > > > > >
| > > > > > > > > > | > > > > > > > > >
| > > > > > > > > > > Thx!! I have set up the homepage using layout tables. 2 questions:
| > > > > > > > > > >
| > > > > > > > > > > 1. I have a seperate htm page that forms the header/top section of the site.
| > > > > > > > > > > Is it better to copy & paste the code into the top row of my layout table, or
| > > > > > > > > > > should I make it a dwt, create editable region and insert the file? (same for
| > > > > > > > > > > left menu/column)
| > > > > > > > > > >
| > > > > > > > > > > 2. If I have my navigation menu in the left box/column - how do I set up the