隐藏一个ASP.NET菜单项 [英] Hide an ASP.NET Menu Item

查看:186
本文介绍了隐藏一个ASP.NET菜单项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个菜单控件的ASP.NET web表单应用程序。一个人如何通过隐藏code特定的菜单项?我已经看到了一些文章指出如何与ASP.Net会员/基于角色的安全做到这一点,但这个特定用例无关这一点。我只是需要一种方法来编程删除code菜单项。任何帮助将是AP preciated。

I have an ASP.NET webforms application with a Menu control. How does one hide a particular menu item via code? I've seen a few articles pointing out how to do it with ASP.Net membership/roles-based security, but this particular use case has nothing to do with that. I simply need a way to programmatically remove a menu item from code. Any help would be appreciated.

推荐答案

卫生署!好吧,我想通了。正确的语法为(VB.Net):

Doh! Ok, I figured it out. The correct syntax is (VB.Net):

mnuMyMenu.Items.Remove(mnuMyMenu.Items(1))

这篇关于隐藏一个ASP.NET菜单项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆