Solved

Problem with menu display.....

Posted on 2006-06-23
3
329 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
This article discusses how to implement server side field validation and display customized error messages to the client.
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…

751 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