473,406 Members | 2,549 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,406 software developers and data experts.

aspmenu require click to activate

Hi,
How do I require a mouseclick before the root menu items will expand instead
of mouse-over on an asp.net 2.0 menu control?
I would like to know how to do this with the menu control in the framework
and not some 3rd party control, please.

To those users out there with an opinion instead of a solution who seem to
require a life's history and ssn# for an answer:
I realize this is usually not the norm, the menu position is in an area of
high mouse traffic and often expands and gets in the way when it's not
needed, but we are not moving it. This is a code question, (with the answer
being possible here is how or not possible), not a design consultation
request.
To anyone else, thank you.
Mar 5 '07 #1
2 1326
Hi,

Based on my understanding, your question is how to make the parent menu
item expand when clicked instead of when hovered on. Let me know if I've
misunderstood anything.

I've done some research by digging into the source code of related classes
using Reflector (http://www.aisto.com/roeder/dotnet/). Unfortunately it's
not possible for ASP.NET built-in Menu control: if you look into the
MenuItem.RenderItem code, you will see the the code:

if ((this.Selectable && this.Enabled) || (this.ChildItems.Count
!= 0))
{
writer.AddAttribute("onmouseover",
"Menu_HoverDynamic(this)");
this.RenderItemEvents(writer);
}
else
{
writer.AddAttribute("onmouseover",
"Menu_HoverDisabled(this)");
writer.AddAttribute("onmouseout", "Menu_Unhover(this)");
}
Also, the click action is used to launch the URL of the menu item, please
note that a parent menu item could also have a URL associated and clicking
on it will navigate to the URL.

Sincerely,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
Mar 6 '07 #2
Hi Walter,
I have downloaded Reflector and plugins. Thanks for the answer and for
the link.

"Walter Wang [MSFT]" wrote:
Hi,

Based on my understanding, your question is how to make the parent menu
item expand when clicked instead of when hovered on. Let me know if I've
misunderstood anything.

I've done some research by digging into the source code of related classes
using Reflector (http://www.aisto.com/roeder/dotnet/). Unfortunately it's
not possible for ASP.NET built-in Menu control: if you look into the
MenuItem.RenderItem code, you will see the the code:

if ((this.Selectable && this.Enabled) || (this.ChildItems.Count
!= 0))
{
writer.AddAttribute("onmouseover",
"Menu_HoverDynamic(this)");
this.RenderItemEvents(writer);
}
else
{
writer.AddAttribute("onmouseover",
"Menu_HoverDisabled(this)");
writer.AddAttribute("onmouseout", "Menu_Unhover(this)");
}
Also, the click action is used to launch the URL of the menu item, please
note that a parent menu item could also have a URL associated and clicking
on it will navigate to the URL.

Sincerely,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
Mar 6 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: john | last post by:
How to call a php function on click of a hyperlink??
21
by: Dan V. | last post by:
I have tried a number of things including preloading, but the background image (water tile in header) in IE 6 will not display where other browsers will....
0
by: Luis Esteban Valencia Muñoz | last post by:
I have a DataList, which looks a bit like this: <asp:DataList id="dlstCheeseType" runat="server" RepeatColumns="4" RepeatDirection="Horizontal" ShowHeader="False" ShowFooter="False"...
0
by: Jim in Arizona | last post by:
I've got a datalist with an ItemTemplate and EditItemTemplate. Its strange (to me), but when I have some records showing (data list items, if you will), and I click the Edit button on the first...
2
by: fniles | last post by:
For IE users, we now encountered a "Click to activate and use this control" when the web page has an ActiveX Control. There is a compatibility patch that changes the default bahavior back to what...
1
by: =?Utf-8?B?KioqKiBLaXRlT3JlZ29uICoqKio=?= | last post by:
I have a page with an aspMenu, i am able to handle the menuItem_click event, however once i handle the event how do i make the page navigate? so how do i make the aspMenu control navigate to a...
1
by: webdeveloper | last post by:
An onclick event that activates two functions: one that expands a menu, another that swaps an image in the same menu hierarchy; in FF, only one click is required to both swap the image and expand...
1
by: ofir | last post by:
WHEN I'M PUBLISH FLASH .SWF FILE IN HTML, I'M GETTING IN WINDOWS THE NOTE: "CLICK TO ACTIVATE AND USE THIS CONTROL" AND MY QUESTION IS, HOW DO I GET A ROUND THAT ??? I SEE MANY WEB SITE THAT...
8
by: ofir | last post by:
WHEN I'M PUBLISHING A FLASH - .SWF FILE IN HTML, I'M GETTING IN WINDOWS THE NOTE: "CLICK TO ACTIVATE AND USE THIS CONTROL" AND MY QUESTION IS, HOW DO I GET A ROUND THAT ??? I SEE MANY WEB SITE...
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
Oralloy
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,...
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...

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.