Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Problem with menu display.....

Posted on 2006-06-23
3
Medium Priority
?
333 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 2000 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
This article discusses how to create an extensible mechanism for linked drop downs.
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…
Suggested Courses

972 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