Click here to Skip to main content
15,888,007 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
Posted

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.
 
Share this answer
 
Comments
kibria06cse 17-Jun-11 0:51am    
Hi Amit,
Can you give me some sample codes for better understanding it..Thanks.....
I have worked with RadMenu and it is as follows

XML
<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........

MIDL
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();
 
Share this answer
 
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.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900