隐藏菜单项 [英] hiding menu items

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

问题描述

在我的项目(使用C#的ASP.NET)中,我希望默认情况下隐藏一些菜单项,并根据角色显示它们,例如管理员登录时可以看到菜单项,而普通用户则看不到....

in my project(asp.net using c#)i want to hide some of the menu items by default and show them depending on the roles like when the admin logins he can see it and normal users cannot see it....

推荐答案

使用Visible属性隐藏或显示asp.net Web控件

con.Visible = false; //隐藏

con.Visible = true;//要显示
use Visible property to hide or show asp.net web controls

con.Visible=false; //to hide
or
con.Visible=true;// to show


,您应该为此使用"web.sitemap".

http://msdn.microsoft.com/en-us/library/ms178428.aspx

请投票表决是否对您有帮助.
you should use "web.sitemap" for this.

http://msdn.microsoft.com/en-us/library/ms178428.aspx

Please Vote if this helped you then.


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

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