Solved

Problem with menu display.....

Posted on 2006-06-23
3
327 Views
Last Modified: 2008-02-01
In my ASP.Net 1.1 C# application, I am generating a menu dynamically and adding it as
text in a literal control.  However, the code is not working.  I am getting a
"document is null[...] or not an object " page error.

Please take a look at what is generated and let me know if you see the cause.
Thanks!

This is the menu item the drop downs are generated for:

<A onmouseover="switchImage('nav8','navOn[8]');MM_showMenu(window.mm_menu_testimonials,<%=JavaMenuX%>,<%=JavaMenuY%>,null,'testimonials');" onmouseout="switchImage('nav8','navOff[8]');MM_startTimeout();" href="#">
      <img height=30 id="testimonials" name="testimonials" src='<%= ResolveUrl("~/Images/nav_testimonials_off.jpg") %>' width=129 border=0 >
</A>

This is the generated menu code:

<script>window.mm_menu_testimonials = new Menu("testimonials",150,20,'verdana','10','#671215','#000000','#faf0e6','#f8ede4','left','middle',  3,  0,  1000,  0,  0,true,false,true,3  ,true,true);
            mm_menu_testimonials.addMenuItem("Mission","location='/content/Mission.aspx'");
            mm_menu_testimonials.bgColor='#FFFFFF';
            mm_menu_testimonials.hideOnMouseOut=true;
            mm_menu_testimonials.menuBorder=0;
            mm_menu_testimonials.menuLiteBgColor='#FFFFFF';
            mm_menu_testimonials.menuBorderBgColor='#FFFFFF';
            mm_menu_testimonials.addMenuItem("Management","location='/content/Management.aspx'");
            mm_menu_testimonials.bgColor='#FFFFFF';
            mm_menu_testimonials.hideOnMouseOut=true;
            mm_menu_testimonials.menuBorder=0;
            mm_menu_testimonials.menuLiteBgColor='#FFFFFF';
            mm_menu_testimonials.menuBorderBgColor='#FFFFFF';
            mm_menu_testimonials.addMenuItem("Careers","location='/content/Careers.aspx'");
            mm_menu_testimonials.bgColor='#FFFFFF';
            mm_menu_testimonials.hideOnMouseOut=true;
            mm_menu_testimonials.menuBorder=0;
            mm_menu_testimonials.menuLiteBgColor='#FFFFFF';
            mm_menu_testimonials.menuBorderBgColor='#FFFFFF';
            mm_menu_testimonials.addMenuItem("ContactUs","location='/ContactUs.aspx'");
            mm_menu_testimonials.bgColor='#FFFFFF';
            mm_menu_testimonials.hideOnMouseOut=true;
            mm_menu_testimonials.menuBorder=0;
            mm_menu_testimonials.menuLiteBgColor='#FFFFFF';
            mm_menu_testimonials.menuBorderBgColor='#FFFFFF';writeMenu();</script>
0
Comment
Question by:JeffDrummond
3 Comments
 

Author Comment

by:JeffDrummond
ID: 16971262
I found one problem.  The name being specified in the switchImage was incorrect.  
I changed nav8 to the name of the image and that works again.

Now I have an "object expected" error.

This is my updated code:

<A onmouseover="switchImage('about','navOn[11]');MM_showMenu(window.mm_menu_about,<%=JavaMenuX%>,<%=JavaMenuY%>,null,'about');" onmouseout="switchImage('about','navOff[11]');" href="#" >
                        <img id="about" name="about" height=30 src='<%= ResolveUrl("~/Images/nav_about_off.jpg") %>' width=79 border=0></A>

<script>window.mm_menu_about = new Menu("about",150,20,'verdana','10','#671215','#000000','#faf0e6','#f8ede4','left','middle',  3,  0,  1000,  0,  0,true,false,true,3  ,true,true);
            mm_menu_about.addMenuItem("Mission","location='/content/Mission.aspx'");
            mm_menu_about.bgColor='#FFFFFF';
            mm_menu_about.hideOnMouseOut=true;
            mm_menu_about.menuBorder=0;
            mm_menu_about.menuLiteBgColor='#FFFFFF';
            mm_menu_about.menuBorderBgColor='#FFFFFF';
            mm_menu_about.addMenuItem("Management","location='/content/Management.aspx'");
            mm_menu_about.bgColor='#FFFFFF';
            mm_menu_about.hideOnMouseOut=true;
            mm_menu_about.menuBorder=0;
            mm_menu_about.menuLiteBgColor='#FFFFFF';
            mm_menu_about.menuBorderBgColor='#FFFFFF';
            mm_menu_about.addMenuItem("Careers","location='/content/Careers.aspx'");
            mm_menu_about.bgColor='#FFFFFF';
            mm_menu_about.hideOnMouseOut=true;
            mm_menu_about.menuBorder=0;
            mm_menu_about.menuLiteBgColor='#FFFFFF';
            mm_menu_about.menuBorderBgColor='#FFFFFF';
            mm_menu_about.addMenuItem("ContactUs","location='/ContactUs.aspx'");
            mm_menu_about.bgColor='#FFFFFF';
            mm_menu_about.hideOnMouseOut=true;
            mm_menu_about.menuBorder=0;
            mm_menu_about.menuLiteBgColor='#FFFFFF';
            mm_menu_about.menuBorderBgColor='#FFFFFF';writeMenu();</script>
0
 
LVL 30

Expert Comment

by:callrs
ID: 16971448
'navOn[11]' --> navOn[11]

Do you need quotes? I know Javascript, not ASP, but I doubt quotes is valid for arrays..
0
 
LVL 17

Accepted Solution

by:
gops1 earned 500 total points
ID: 16974044
Can you put the generated source for this line:

<A onmouseover="switchImage('nav8','navOn[8]');MM_showMenu(window.mm_menu_testimonials,<%=JavaMenuX%>,<%=JavaMenuY%>,null,'testimonials');" onmouseout="switchImage('nav8','navOff[8]');MM_startTimeout();" href="#">
     <img height=30 id="testimonials" name="testimonials" src='<%= ResolveUrl("~/Images/nav_testimonials_off.jpg") %>' width=129 border=0 >
</A>

or try putting qoutes for you java variables:

<A onmouseover="switchImage('nav8','navOn[8]');MM_showMenu(window.mm_menu_testimonials,"<%=JavaMenuX%>","<%=JavaMenuY%>",null,'testimonials');" onmouseout="switchImage('nav8','navOff[8]');MM_startTimeout();" href="#">
     <img height=30 id="testimonials" name="testimonials" src='<%= ResolveUrl("~/Images/nav_testimonials_off.jpg") %>' width=129 border=0 >
</A>
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Avoid defining the variables in the global scope; trying to define them in a local function scope. Because:   • Look-up is performed every time a variable is accessed.   • Variables are resolved backwards from most specific to least specific scope…
Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

837 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question