Click here to Skip to main content
15,891,409 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
I am working on a menu in a asp.net website, where the menu will be completely dynamic, i.e from the sql server database. I am using "smart menu", and the menu will be shown in the website according to the user access permission, i.e a particular user will only see the menus which this user is having permission to access. can any one please help me out on how to make this menu dynamic an user based. Thanks in Advance.
Posted
Updated 23-Apr-11 22:14pm
v2
Comments
R. Giskard Reventlov 24-Apr-11 4:13am    
Is there a question in there?
Subhabrata Bose 24-Apr-11 4:14am    
just check the updation
Ed Nutting 24-Apr-11 5:42am    
You seem to have everything you need, where's the problem? What are you stuck on? Have you tried anything yourself and if so, can you post it? What you need is simple code that looks at what user is logged in, what permissions they have and then gets all the bits of menu they are allowed to see from the database. Then build those into the page when the user requests a page.
Subhabrata Bose 24-Apr-11 7:24am    
i have created a database table for main menu and sub menu. i have inserted the menu names into the database. but when i am trying to retrieve those menu names in the menu.... it not happening..
the main thing is that i need an example of dynamic menu in asp.net based on user.
Ed Nutting 24-Apr-11 8:30am    
So your problem is not the menu but actually retrieving stuff from a database? Try searching Google or CodeProject on how to retrieve stuff from databases. If your using Vsiual Studio and MS SQL Server I suggest you look at the Linq to SQl class. If your problem is that you have the database records but can't display anything to a page you need to look at how to update a page dynamically but I would expect that to be fairly obvious. If what you're looking for is for someone to produce a menu that links to a database and user system for you then:

1) Your a student you should be doing it yourself,
2) No-one's going to want to do it for you unless you pay or you search Google on the offchance there is one and
3) You're unlikely to find anything that fits in exactly with what you already have.

It's best and easiest to start from scratch. Ed

1 solution

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#)[^]
 
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