Solved

Problem with menu display.....

Posted on 2006-06-23
3
328 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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

The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
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…

679 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