473,735 Members | 11,066 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How can I set the menu control height?

6 New Member

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>
So my question is :
Does anybody know how to set the height of the menu?
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.


.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>
Sep 16 '08 #1
4 4052
979 Recognized Expert Contributor
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
797 Recognized Expert Contributor
Hmm... I came across a question like this yesterday and called no joy on it... :oP
Sep 16 '08 #3
6 New Member
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.

Sep 16 '08 #4
6 New Member
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.as px
and the MSDN Magazine did an article on it in October 2006 Ö itís in the MSDN Library

Sep 18 '08 #5

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

Similar topics

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 http://home.pacific.net.sg/~jacksony ? (the drop down bar could not work at www.apchosting.net but can drop at home.pacific.net.sg. I suspect it is a server problem but was told it is not possible, therefore assuming it is a client script problem? the script works last time...
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 looking for. i am looking for code to make a dynamical menu with submenus The menu items are stored in a MS SQL Table and when by loading the page the items will be created. i have made a asp table. i want my menu on the left cell, in the middle...
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 normaly becomes a full line and the height of the menuitem is reduced but when you set a menu to ownerdraw and use my draw and measure item handlers this doesn't work anymore, has anyone worked out a good sloution for this before? Greetz Peter
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 nothing with an ico if you want to show an icon in the menu) also add a module and copy paste the code at the bottom of the message. Private Sub MenuItem1_DrawItem1(ByVal sender As Object, ByVal e As _
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 menu item, the page will send back the id of the menu that was clicked. But it doesn't do that and I can't figure out how to make it work. Looking at the code below, the variable "strDBView" is always null. But it's a global variable and gets...
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 ------------------- DropDown Item 1 DropDown Item 2
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 if it works, and if it does not, tell me why it does not work. Thanks.
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. here is the site I am having trouble with. http://www.866hdrental.com/new_site/index.htm here is the navigation css: .moveover { text-align: left;
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 "background" or "background-image", the positioning only works with specifying pixels. If I specify the vertical position in pixels, the image gets cut-off at the bottom. I don't know what to do and would appreciate anyone's help. Specifically the code...
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, weíll explore What is ONU, What Is Router, ONU & Routerís main usage, and What is the difference between ONU and Router. Letís take a closer look ! Part I. Meaning of...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Duprť who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.