简体   繁体   English

单击时不会关闭的ASP.NET MenuItem

[英]ASP.NET MenuItem that doesn't close when clicked

I am using an ASP.NET Menu Control in my website. 我在网站上使用ASP.NET菜单控件。 If the user clicks on a menu item that has sub menus, I would want the menu to stay open and the page to do nothing. 如果用户单击具有子菜单的菜单项,则希望菜单保持打开状态,并且页面不执行任何操作。 Is this possible? 这可能吗?

Set the DisappearAfter property to -1 and it will wait for the user to click somewhere to close the menu. DisappearAfter属性设置为-1,它将等待用户单击某处以关闭菜单。 See the Dynamic Appearance Timing section in the docs . 请参阅文档中的“动态外观计时”部分。

The default value is 500 milliseconds. 默认值为500毫秒。 If the value of DisappearAfter is set to 0, pausing outside of the Menu control causes it to disappear immediately. 如果DisappearAfter的值设置为0,则在Menu控件外部暂停会使其立即消失。 Setting the value to -1 indicates that the pause time should be infinite, and only by clicking outside of the Menu control will the dynamic portion vanish. 将该值设置为-1表示暂停时间应该是无限的,只有在菜单控件之外单击才能使动态部分消失。

Setting the menu's RenderingMode property to List results to the desired behavior. 将菜单的RenderingMode属性设置为List可以得到所需的行为。 However, this messes up the layout of the menu. 但是,这弄乱了菜单的布局。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM