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:08

problem with asp page


Poster: v8kmj
Dated: Wednesday September 29 2004 - 15:34:05 BST

I'm sure it's something I'm doing wrong, but when I drop the code into an ASP page, the menus don't work. They work fine in an HTML page.

Pages are at:

http://www.companyregistrations.co.uk/test.htm

http://www.companyregistrations.co.uk/test.asp

Code below:

ASP Page

<% __at__ LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>
<html>
<head>
<title>Untitled Document</title>
</head>
<script type="text/javascript" src="milonic_src.js"></script>
<script type="text/javascript">
<!--
if(ns4)_d.write("<script language=JavaScript src=mmenuns4.js><\/script>");
else _d.write("<script language=JavaScript src=mmenudom.js><\/script>");
-->
</script>
<script type="text/javascript" src="menu_data.js"></script>
<body>

</body>
</html>


HTM Page

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<script type="text/javascript" src="milonic_src.js"></script>
<script type="text/javascript">
<!--
if(ns4)_d.write("<script language=JavaScript src=mmenuns4.js><\/script>");
else _d.write("<script language=JavaScript src=mmenudom.js><\/script>");
-->
</script>
<script type="text/javascript" src="menu_data.js"></script>
<body>

</body>
</html>


Poster: Ruth
Dated: Thursday September 30 2004 - 3:07:26 BST

I don't know anything about asp, but you might want to take a look at these posts. I don't know if they will be of help. And, the link for the asp page is not working, it says page not found.

http://www.milonic.com/forum/viewtopic.php?p=23466
http://www.milonic.com/forum/viewtopic.php?p=23521

Ruth


Poster: EighteenNinetyEight
Dated: Sunday October 3 2004 - 0:41:09 BST

Hello,

I really like the features and customization of the Milonic software.

I would love to purchase it. However, I, like at least 1/3 of the web development community use microsoft active server pages.

I am having the same problem as the user who started this thread.

if the exact same code is placed in a file with the extention .asp as opposed to .htm the page cannot be displayed.

Pages:
http://www.gohrsch.com/test.html
http://www.gohrsch.com/test.asp

Code:

<head>
<title>Untitled Document</title>
<script type="text/javascript" src="milonic_src.js"></script>
<script type="text/javascript">
<!--
if(ns4)_d.write("<script language=JavaScript src=mmenuns4.js><\/script>");
else _d.write("<script language=JavaScript src=mmenudom.js><\/script>");
-->
</script>
<script type="text/javascript" src="menu_data.js"></script>
</head>

Upon further investigation, I can sometimes generate the following error:

Active Server Pages error 'ASP 0138'
Nested Script Block
/test.asp, line 10
A script block cannot be placed inside another script block.

If i remove the offending javascript tag (the second javascript tag), then nothing at all appears on the page.

I really hope Milonic takes this concern seriously and can figure out a solution. I really want to use this navigation system and I'm sure thousands of other ASP develpers would as well.

Thanks,

James


Poster: Ruth
Dated: Sunday October 3 2004 - 2:39:04 BST

Did you check the two links to see if they were any help?

Ruth


Poster: kevin3442
Dated: Sunday October 3 2004 - 5:28:23 BST

Hi James,
EighteenNinetyEight wrote:
...I really hope Milonic takes this concern seriously...

I think I can safely speak for Milonic by saying that they take every concern of every customer or potential customer seriously. I think you'll find the support they offer hard to beat in any comparable product (keeping in mind that I am clearly biased ;) )

EighteenNinetyEight wrote:
...if the exact same code is placed in a file with the extention .asp as opposed to .htm the page cannot be displayed...

Active Server Pages error 'ASP 0138'
Nested Script Block
/test.asp, line 10
A script block cannot be placed inside another script block

Thanks for posting the error message. That helped a lot. I don't know about the line number (10), but the only nested script blocks occur in the lines that test whether the browser is ns4 or not, to determine whether to load mmenuns4.js or mmenudom.js. I would therefore suggest changing the following lines:
Code:
if(ns4)_d.write("<script language=JavaScript src=mmenuns4.js><\/script>");
else _d.write("<script language=JavaScript src=mmenudom.js><\/script>");

to this:
Code:
if(ns4)_d.write("<scr"+"ipt language=JavaScript src=mmenuns4.js><\/scr"+"ipt>");
  else _d.write("<scr"+"ipt language=JavaScript src=mmenudom.js><\/scr"+"ipt>");

I tested this, making the substitution in the test code you posted and, as you can see here, it works.

The full index.asp code I used to test:
Code:
<head>
<title>Untitled Document</title>
<script type="text/javascript" src="milonic_src.js"></script>
<script   type="text/javascript">
<!--
if(ns4)_d.write("<scr"+"ipt language=JavaScript src=mmenuns4.js><\/scr"+"ipt>");
  else _d.write("<scr"+"ipt language=JavaScript src=mmenudom.js><\/scr"+"ipt>");
-->
</script>
<script type="text/javascript" src="menu_data.js"></script>
</head>

Breaking "script" into two separate strings in the document.write() output seems to do the trick to get around the nested <script> block problem. You'll notice that this is how the menu scripts are loaded in the downloadable samples from the main site... I'm guessing that this might be one of the reasons why. I did, however, notice that the sample code given in the install.txt file that comes with the downloads is the same script that you and v8kmj used; it does not break "script" up. I'm thinking that the install.txt file should be updated.

I hope this solves the problem for both you and v8kmj. And I hope you decide to purchase a license; you won't regret it.

Cheers,

Kevin

YAY!!!


Poster: EighteenNinetyEight
Dated: Sunday October 3 2004 - 20:38:06 BST

Thanks! You saved the day!!!

(And very promptly)

I've really liked Milonic ever since that hilarious incedent with Orin Hatch!

James

Not working in Netscape 4


Poster: EighteenNinetyEight
Dated: Sunday October 3 2004 - 21:21:46 BST

Hey so, this menu is completely blank when loading in netscape 4...
http://www.gohrsch.com/test2.asp

Code:
Code:
<html>
<head>
<title>Untitled Document</title>
<script type="text/javascript" src="milonic_src.js"></script>
<script type="text/javascript">
<!--
if(ns4)_d.write("<scr"+"ipt language=JavaScript src=mmenuns4.js><\/scr"+"ipt>");
  else _d.write("<scr"+"ipt language=JavaScript src=mmenudom.js><\/scr"+"ipt>");
-->
</script>
<script type="text/javascript" src="menu_data.js"></script>

</head>

<body>
Hello
</body>
</html>



The link to the file seems right. But I tried loading the milonic home page in my version of netscape 4 and it does work.

What might I be doing wrong.[/url]

Problem with Netscape 4 solved


Poster: EighteenNinetyEight
Dated: Sunday October 3 2004 - 21:46:42 BST

Ok, I figured out the netscape problem I was having by comparing my code with the code on the milonic home page.

Apparently, the comment tags were preventing Netscape 4 from displaying the menu.

Here's the working code:

Code:
<html>
<head>
<title>Untitled Document</title>
<script type="text/javascript" src="milonic_src.js"></script>
<script type="text/javascript">

if(ns4)_d.write("<scr"+"ipt language=JavaScript src=mmenuns4.js><\/scr"+"ipt>");
  else _d.write("<scr"+"ipt language=JavaScript src=mmenudom.js><\/scr"+"ipt>");

</script>
<script type="text/javascript" src="menu_data.js"></script>

</head>

<body>
Hello
</body>
</html>


Thanks again everyone!

James