473,397 Members | 2,099 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

How can I set the menu control height?

Hi,

I have a page with a scrollable DIV, and within that DIV, I have a few asp.net menu controls. The idea being, the user mouses over the small icons and is presented with a list of options.

One of these lists has more data than the page allows for, so the menu control automatically creates the scroll up / scroll down commands at both ends of the menu. The problem is; since it is within a scrollable div, the menu scroller are hidden! The user needs to scroll the div, in order to scroll the menu!

I'm attempting to resolve this, by making the menu shorter, but the height property doesn't appear to work.

I've attached concise sample code below, and as you can see I want the menu to be 2 inches long. The background is only colored for 2 inches, but the menu goes the full length of the window.

I've also attempted to resolve it by adding the following code to the top of the page, but when the user tries to scroll it, the menu disappears.
Expand|Select|Wrap|Line Numbers
  1. <style>#ctl01n0Items {height:2in;overflow-y:auto;}</style>
  2.  
So my question is :
Does anybody know how to set the height of the menu?
Or
Does anybody know how to get the menu to autosize according to it's container, not the full window client area.

Thanks in advance, I'm hoping I'm missing something simple.

Regards,
John

.NET v2.0
IE 7.0.5730.11

Expand|Select|Wrap|Line Numbers
  1. <asp:menu 
  2.     DynamicMenuStyle-Height="2in"
  3.     DynamicMenuStyle-BackColor="LightBlue"
  4.     runat="server">
  5.     <items>
  6.         <asp:menuitem text="My Menu">
  7.             <asp:menuitem text="Item 1"/>
  8.             <asp:menuitem text="Item 2"/>
  9.             <asp:menuitem text="Item 3"/>
  10.             <asp:menuitem text="Item 4"/>
  11.             <asp:menuitem text="Item 5"/>
  12.             <asp:menuitem text="Item 6"/>
  13.             <asp:menuitem text="Item 7"/>
  14.             <asp:menuitem text="Item 8"/>
  15.             <asp:menuitem text="Item 9"/>
  16.             <asp:menuitem text="Item 10"/>
  17.             <asp:menuitem text="Item 11"/>
  18.             <asp:menuitem text="Item 12"/>
  19.             <asp:menuitem text="Item 13"/>
  20.             <asp:menuitem text="Item 14"/>
  21.             <asp:menuitem text="Item 15"/>
  22.             <asp:menuitem text="Item 16"/>
  23.             <asp:menuitem text="Item 17"/>
  24.             <asp:menuitem text="Item 18"/>
  25.             <asp:menuitem text="Item 19"/>
  26.             <asp:menuitem text="Item 20"/>
  27.             <asp:menuitem text="Item 21"/>
  28.             <asp:menuitem text="Item 22"/>
  29.             <asp:menuitem text="Item 23"/>
  30.             <asp:menuitem text="Item 24"/>
  31.             <asp:menuitem text="Item 25"/>
  32.             <asp:menuitem text="Item 26"/>
  33.             <asp:menuitem text="Item 27"/>
  34.             <asp:menuitem text="Item 28"/>
  35.             <asp:menuitem text="Item 29"/>
  36.             <asp:menuitem text="Item 30"/>
  37.         </asp:menuitem>
  38.     </items>
  39. </asp:menu>
  40.  
Sep 16 '08 #1
4 4026
DrBunchman
979 Expert 512MB
Hi John,

Welcome to Bytes.com! I hope you find the site useful.

You've posted your question in the ASP Forum which is for Classic ASP only - I've moved it for you but in future please post all ASP.NET questions in the .NET Forum.

Dr B
Sep 16 '08 #2
balabaster
797 Expert 512MB
Hmm... I came across a question like this yesterday and called no joy on it... :oP
Sep 16 '08 #3
Hi John,

Welcome to Bytes.com! I hope you find the site useful.

You've posted your question in the ASP Forum which is for Classic ASP only - I've moved it for you but in future please post all ASP.NET questions in the .NET Forum.

Dr B
Thanks Dr B. I wasn't sure which forum was for asp.net, so I just assumed it was ASP since it was under web development.

Anyway, thanks again for moving it to the correct forum.

John
Sep 16 '08 #4
Thanks for the comments guys.

Anyway, I wound up grouping the items into submenus so I could resolve the situation immediately and deploy. I don't know if I'd get any ROI by doing anything else at this point.

One idea I did get in case anybody else ever has this issue is to implement control adapters. It's not worth it for me in this case, but it may be a good solution in other cases.

Scott Guthrie has a blog post about Control Adapters at http://weblogs.asp.net/scottgu/archive/2005/12/21/asp-net-2-0-control-adapter-architecture.aspx
and the MSDN Magazine did an article on it in October 2006 … it’s in the MSDN Library

Sincerely,
John
Sep 18 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Jackson Yap | last post by:
can someone kind enough to help me look at the attached html and js file? Why is it that the javascript menu could not work at www.apchosting.net but could work at...
4
by: paula | last post by:
I've got a problem with asp.net i am trying to make a menu control. and have searched the web for serveral controls but they don't work correctly. I am pretty new to asp.net building. What am i...
2
by: Peter Proost | last post by:
Hi group, I've got this ownerdraw menu module which I got from a site and modified to my personal needs, but the only problem I'm having is with the lines in a menu, when you type - as text, it...
2
by: Peter Proost | last post by:
Hi, I've got the following ownerdraw menu: drag a mainmenu on a form and add some menuitems to it, set all the menuitems to ownerdraw = true and for every menuitem add this code (replace...
2
by: John Smith | last post by:
I am trying to use the menu control for a tabbed menu system but it's frustrating the hell out of me. The full code is listed below. The trouble that I'm having is that, when the user clicks on a...
6
by: clintonG | last post by:
I haven't learned this control yet but I do need to know if it can be configured to drop down instead of fly-out? // Like this... ------------------- Static Root Label -------------------...
4
by: TycoonUK | last post by:
Hi, As I do not have IE7 on my computer, I was wondering if there is a fault in my CSS Menu when using IE7. Please can someone look at my site - http://www.worldofmonopoly.co.uk and tell me...
4
by: tonsi | last post by:
I have a css menu that works great in IE7 and other browser but when you check it in IE 6 it only shows the first dropdown. I am not that great at css but ANY help would be greatly appreciated. ...
16
by: stevedude | last post by:
CSS newbie again. I have a problem trying to get coffee mug images within anchor tags to center with my link text for a vertical list menu. If I use the horizontal/vertical properties of...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.