473,549 Members | 2,655 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How can I set the menu control height?

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

John
Sep 16 '08 #4
stuckagain
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

Sincerely,
John
Sep 18 '08 #5

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

Similar topics

2
3865
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...
4
3987
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...
2
1253
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...
2
1330
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...
2
1655
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. ...
6
1668
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
4
9277
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.
4
4189
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:...
16
4918
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...
0
7541
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, 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...
0
7979
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7497
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6065
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5385
isladogs
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...
0
5107
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...
0
3512
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1960
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1074
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.