Board Logo

Placement of "New menu" in content frame
Frenzy - 8/19/2003 at 12:41 PM

Just a little question :
When using the menu in a frames environment, is it wrong to put the declaration of the menu in the content-frame in the header ( between the <head> </head tags), instead of just before the </body> tag ?
It seems to work just fine, and i don't have any problems with my frame-loading order anymore.


nik - 8/19/2003 at 01:02 PM

Assuming constructive characteristics it is possible in "master" but not "slave" frame.


Frenzy - 8/19/2003 at 01:09 PM

Strange thing is, it works...
But only if i use Server-Side Includes in my ASP site !

I have 2 include : "Include_menu_Header" which has the css en .js declarations neede for the menu, and 'Include_Menu_content", which creates a different menu depending on a variable in the session object.
When i use the following in the header of the "slave" ( content ) frames
<!-- #Include file="Include_Menu_header.asp" -->
<!-- #Include file="Include_Menu_content.asp" -->

it works, but when i put the code in "Include_menu_content.asp" and paste it in "Include_Menu_header.asp" it doesn't....
Strange, isn't it ?


nik - 8/19/2003 at 01:28 PM

And if you just rename index.html from any menu demo into index.asp does it stop working?


Frenzy - 8/19/2003 at 01:35 PM

Quote:
Originally posted by nik
And if you just rename index.html from any menu demo into index.asp does it stop working?

NO, it doesn't, it still works.
Shouldn't it work ?


nik - 8/19/2003 at 01:42 PM

Try to write ASP code inside <% %> tags in such a way:

<%
' any ASP code
%>


Frenzy - 8/19/2003 at 01:47 PM

Quote:
Originally posted by nik
Try to write ASP code inside <% %> tags in such a way:

<%
' any ASP code
%>

i know that, i am not e newby in the field of ASP.

but to illustrate :
the content of the file "Include_Menu_Header.asp" :
<link rel="stylesheet" href="menu_files/menu.css">
<script language="JavaScript" src="menu_files/menu.js"></script>
<script language="JavaScript" src="menu_files/menu_items.js"></script>
<script language="JavaScript" src="menu_files/menu_tpl.js"></script>

The content of file "Include_Menu_content.asp" :
<script language="JavaScript">
<!--
<%
Select case session("section")
case "2"
%>
new menu (MENU_ITEMS_THEATER, MENU_POS0);
<%
case "3"
%>
new menu (MENU_ITEMS_HORECA, MENU_POS0);
<%
case "4"
case "5"
%>
new menu (MENU_ITEMS_ALGEMEEN, MENU_POS0);
<%
case "6"
%>
new menu (MENU_ITEMS_JONGEREN, MENU_POS0);
<%
end select
%>
//-->
</script>

If i include both files separately after each other :
<!-- #Include file="Include_Menu_header.asp" -->
<!-- #Include file="Include_Menu_content.asp" -->

Then it works, but if i combine the code in both include and include that into my pages, it doesn't


nik - 8/19/2003 at 01:52 PM

And what error message appears?


Frenzy - 8/19/2003 at 02:04 PM

Quote:
Originally posted by nik
And what error message appears?

None at all, the menu in the content frame just doesn't show.

My theory is that the server executes the includes before it continues to process the rest of the page, although i always thought that all includes would be read before any code got processed by the server.


nik - 8/19/2003 at 02:16 PM

You should close bracket in:
Select case session("section"
If you close it everything should work fine.


Frenzy - 8/19/2003 at 02:24 PM

Quote:
Originally posted by nik
You should close bracket in:
Select case session("section"
If you close it everything should work fine.

It is closed, but the forum software shows it as a smiley


nik - 8/19/2003 at 02:37 PM

Please, send whole file via http://www.softcomplex.com/support/ if it is possible.


Frenzy - 8/19/2003 at 02:47 PM

I'll see if i can make some time to make a demo.


Softcomplex: http://www.softcomplex.com/
Back to forum: http://www.softcomplex.com/forum/