Milonic provide full featured pull down web menus for some of the worlds largest companies
click here to see what it can do for you

Download Milonic DHTML Menu
Buy Milonic DHTML Menu

Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:19

ASP.NET 2.0 Master Page Problem

Poster: gelid
Dated: Tuesday January 3 2006 - 18:46:13 GMT

I am using the menu in an ASP.NET Master Page which is inherited by several other pages. Sometimes the menu displays and sometimes it does not. I dynamically set the menu location and other variables on the master page based on what child page is inheriting the master page.

Below is an example of the master page menu references.

<script id="Script1" language="JavaScript" src='<%=HomeDirectory%>Library/Menu/SETTINGS.js'></script>
<script language="JavaScript" src="<%=HomeDirectory %>Library/Menu/milonic_src.js" type="text/javascript"></script>
<script language="JavaScript">
if(ns4)_d.write("<scr"+"ipt language=JavaScript src=<%=HomeDirectory %>Library/Menu/mmenuns4.js><\/scr"+"ipt>");
else _d.write("<scr"+"ipt language=JavaScript src=<%=HomeDirectory %>Library/Menu/mmenudom.js><\/scr"+"ipt>");
<script src="<%=MenuSource %>" type="text/javascript"></script>
<script type="text/javascript">drawMenus();</script>

The source on the page shows that the menu items were written to the page correctly. Also, if I have a page that initially displays a criteria form to the user that is used to allow DB searching, the menu initially does not show up. But when the user submits the search, the results are displayed and the menu appears.

I am at a loss on this one. Has anyone else experienced this issue? Any incite would be greatly appreciated. 2.0 Master Page Sub folder Relative URL error

Poster: phatmike11
Dated: Thursday February 2 2006 - 18:07:30 GMT

I am having a similar problem. I was running to issues with the images on the page not working under sub folders. I then changed all the images on the page to <asp:image ~/images/imageName.gif>. THat fixed my image problem. Now when the page is rendered it converts the ~ into .. or ../.. However, I have not found a fix for the javascript! Any suggestions? I have tried putting the ~/ into front of the mmenuns4.js file but that only works for server side stuff. If you try and make the script server side it buggers out. I am sure the answer lies in some processing in the codebehind or something, but have to have found a good answer.

<script type="text/javascript" src='milonic_src.js'></script><noscript><div style="width: 655px;"><center>Javascript is disabled, please enable it.</center></div></noscript>
<script type="text/javascript">
if(ns4)_d.write("<scr"+"ipt type=text/javascript src=mmenuns4.js><\/scr"+"ipt>");
else _d.write("<scr"+"ipt type=text/javascript src=mmenudom.js><\/scr"+"ipt>");
<script type="text/javascript" src="menu_data.js">function IMG1_onclick() { }

Has anyone resolved this problem?

Poster: ddudley3
Dated: Thursday August 17 2006 - 5:30:38 BST

I am experiencing a similar problem adding the menu to the ASP.NET for VS Web Developer Express.

Has anyone come up with a resolution to this?

Poster: Andy
Dated: Tuesday August 22 2006 - 11:56:03 BST

Do you have any URL's that we can see where the problem exists?

Poster: ddudley3
Dated: Wednesday August 23 2006 - 0:13:52 BST

No. I was doing this on my laptop before I copied it to my website.

I ended up using a javascript CSS menu .. But I'm not entirely thrilled with it.

However here is the Master Page ASPX Code:
<% __at__ Master Language="VB" CodeFile="Default.master.vb" Inherits="Default_master" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">

<html xmlns="" xml:lang="en" >
<head runat="server">
<title>My Website</title>
<form id="form1" runat="server">
<div class="header" style="left: 0px; top: 0px; height: 49px;">
<h1 style="font-family: 'Arial Narrow'; left: 16px; top: 0px; font-size: 16pt;">
<h2 style="left: 15px; top: 25px; font-family: 'Arial Narrow'; font-size: 14pt; width: 259px;">
"the place to be"</h2>
<br />
<br />
<br />
<br />
<br />
<br />

<!-- ***** This is the section of code you need to paste into your web pages ***** -->
<script type='text/javascript'>

//HV Menu- by Ger Versluis (
//Submitted to Dynamic Drive (
//Visit for this script and more

function Go(){return}

<script type='text/javascript' src='exmplmenu_var.js'></script>
<script type='text/javascript' src='menu_com.js'></script>
<noscript>Your browser does not support script</noscript>
<!-- **** JavaScript Menu HTML Code -->


<asp:contentplaceholder id="Main" runat="server" />

<div class="footerbg">
<div class="footer" style="font-family: 'Arial Rounded MT Bold'">
&nbsp;This is my footer area

<asp:sitemapdatasource id="SiteMapDataSource1" runat="server" startingnodeoffset="0" />




And I used the js files that came with the files.

Poster: Andy
Dated: Wednesday August 23 2006 - 12:06:04 BST


We really are going to need to see URL's so that we can test them.

Will this be possible?


Poster: Andy
Dated: Monday January 8 2007 - 12:01:55 GMT

Apparently, here is what you need to do:

ASP.NET 2.0 master pages
Message: I was working on a problem with your menu when creating new pages in multiple directories that derive from a master page in VS2005 with .net 2.0. I came across a post on your messageboard with a similar problem and thought I would share the solution.

You will need to use ~/ to resolve the src path of the staticly coded script tags, and hard code the path in the dynamicly created script tag. Now the master page can be referenced by any page in the solution and the scripts that drive the menu will show up fine.