管理员控制的菜单栏 [英] menubar controlling for administrator

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

问题描述

大家好,
我想创建一个网站,当他是管理员时可以进入一个菜单或该菜单的某个子菜单,否则它将不可见或无法修改.这是一个问题,另一个问题是我想锁定插入内容普通用户在ASP.NET 3.5中对页面进行,更新,删除,编辑命令字段.那我该怎么办呢?

请帮帮我.

在此先感谢.

最好的问候,

Hi All,
I want to create a website where one can enter a menu or some submenu of that menu when he is a administrator,otherwise it will be invisible or no one can modified.This is one of question,other question is I want to lock the insert,update,delete,edit commandfield of a page in a ASP.NET 3.5 for the normal users.So how can I do it?

Please help me.

Thanks in Advance.

Best Regards,
Golam kibria.

推荐答案

U必须为菜单创建两个表,第一个具有菜单,第二个具有允许查看的对象的详细信息,

或者,您可以在这种情况下检查谁已登录,可以将数据源设置为菜单控制器,但是首先您必须根据已登录的用户选择菜单.
U have to create two tables for the menu, first one having menu and second having the details of to whom it is allowed to be viewed,

or u can check who is logged in on that condition u can set the datasource to the menu controller, but first u have to select the menu on the basis of the logged in user.


I与RadMenu一起使用,如下所示

I have worked with RadMenu and it is as follows

<telerik:RadMenu runat="server" ID="RadMenu2" BeforeClientContextMenu="beforeClientContextMenu"

                                        Skin="Telerik" OnItemClick="RadMenu2_OnItemClick">
                                    </telerik:RadMenu>




这应该是您对登录用户的选择查询........




Here should be ur select query for the logged in user........

RadMenu2.DataTextField = "MenuName";
                RadMenu2.DataNavigateUrlField = "";
                RadMenu2.DataFieldID = "MenuId";
                RadMenu2.DataFieldParentID = "ParentMenuId";
                RadMenu2.DataValueField = "MenuId";


                RadMenu2.DataSource = (DataSet)Convert.ChangeType(Session["ssnMenuItemsDS"], typeof(DataSet));
                RadMenu2.DataBind();


您需要根据用户权限过滤数据源.

考虑以下选项...

选项
添加数据
编辑数据
查看数据
删除数据
打印数据



用户类型
管理员用户
普通用户


如果用户是管理员用户",则允许所有选项.如果用户普通用户"随后限制了某些选项(例如删除",打印"),则请过滤数据源.


选项(对于普通用户)
添加数据
编辑数据
查看数据


供您参考

如何在ASP.NET(C#)中创建数据库驱动菜单 [ ^ ]

如何以编程方式启用,禁用菜单 [ ^ ]

免费附件

ASP.NET菜单示例 [在ASP.NET中编辑各个GridView单元格 [
You need to filter the datasource based on user rights.

Consider the below options...

Options
Add Data
Edit Data
View Data
Delete Data
Print Data



User Type
Admin User
Normal User


If the user is Admin User then allow all options. If the user Normal User then restrict some options(Like Delete, Print) so filter the datasource.


Options (For Normal User)
Add Data
Edit Data
View Data


For your information

How To Create Database Driven Menu in ASP.NET (C#)[^]

How to enable, disable Menu programmatically[^]

Free attachment

ASP.NET Menu Examples[^](Around 35 examples about Menu control)

For your 2nd question

Edit Individual GridView Cells in ASP.NET[^]

It contains coding for hide the columns in Gridview so you can disable them well.


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

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