The site is currently in read-only mode for maintenance. Posting of new items will be available again shortly.
Table Of Contents
This article demonstrates, how to form the Main menu through database based on given login user. Here I have given the table model and menu formation method. As in the previous article, which discussed XML driven menus generated at runtime, this article focuses on building menu through
For demo purpose, I have created the
DataSet in runtime.
Menu level Security
We can give the permission to user for a particular screen or action through menu, when an application is loading itself. Like what are all the menus available to the user.
Flow for Menu level Security
The following figure shows the flow of this type of security model.
See the table design below, I have added one column
USERID. I have designed this table for demo purpose. So I didn't concern about normalization. You can design your table model, but SQL query output should be like
See the Login Form below, you can select a user from here.
The menu will be shown like for USERID='DEMO',
A recursive method
CreateMenuItems has been used to create all the menu items. I have changed the
CreateMenuItems little bit to use a
I think this shows how you can implement the security in MainMenu through database and any help, comments are much appreciated!