Role Based Menu and Submenu Default page

Posted by Webmasters964 under ASP.NET on 8/27/2013 | Points: 10 | Views : 5877 | Status : [Member] | Replies : 9
Role Based Menu and Submenu Default page
Role Type
? Super Admin
? Admin
? User
How to Login Hide and Show Menu and Submenu with database SQLQuery
Explain:-Only One Menu
Menu SuperAdmin (ul)
? Show all Menu and Submenu
Menu Admin (ul)
? Submenu (li)
o Home
o Report
o Profile
o About
Menu User (ul)
? Submenu (li)
o Home
o Profile
Please give any idea about How to Create Role Based Menu and Submenu Hide and Show in Default.aspx page. Using HtmlGenericControl asp .net and How to use sql database .

Thanks & Regards
Jay Kumar




Responses

Posted by: Bandi on: 8/28/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
I will provide you the DB structure to achieve the role based menus...
APPL_MENU --> [menu_id] (Primary key), [parent_menu_id] (self reference) ,[display_seq_nbr],[menu_name],[menu_desc],[active_ind]

APPL_ROLE --> [role_code] (Primary key),[role_name]
APPL_USER --> UserId(Primary key), User_Name
APPL_USER_ROLE --> userid (Reference of APPL_USER ), role_code (Reference of APPL_ROLE ), [active_ind]
APPL_ROLE_Menu --> [role_code] (Reference of APPL_ROLE ),[menu_id] (Reference of APPL_MENU ),[landing_menu_ind],[read_only_ind]

Look into the below URL to get idea on role-based menu & Submenus
http://forums.asp.net/t/1616659.aspx

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Webmasters964, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Webmasters964 on: 8/28/2013 [Member] Starter | Points: 25

Up
0
Down
this code without DB structure login page help
 Download source file

Webmasters964, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bandi on: 8/28/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
I doesn't have permission to download files in my office..
Refer this link for Dynamic SubMenu display
http://www.codeproject.com/Tips/354696/Dynamically-populating-menu-items-from-the-databas

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Webmasters964, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Webmasters964 on: 8/28/2013 [Member] Starter | Points: 25

Up
0
Down
Login page Role base Default page Menu. Hide and Show Menu and Submenu

Login Role Type
Super Admin
Admin
User

Response.Redirect("Default.aspx");
only Redirect Default page
any idea DB structure for login page ?

Webmasters964, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Webmasters964 on: 8/28/2013 [Member] Starter | Points: 25

Up
0
Down
try this codeproject link but No solution


Webmasters964, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bandi on: 8/28/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
The following is the DB structure for Login Page:

CREATE TABLE APPL_ROLE ([role_code] INT Primary key,[role_name] VARCHAR(40) NOT NULL)

role_code role_name
--------- -----------
1 Super Admin
2 Administrator
3 User

CREATE TABLE APPL_USER(
[LOGIN_ID] [char](8) PRIMARY KEY,
[LogIn_Key] VARCHAR(50) NOT NULL,
[user_display_name] [varchar](50) NOT NULL,
[active_ind] [char](1) NOT NULL)

CREATE TABLE APPL_USER_ROLE(
userid [char](8) References APPL_USER(LOGIN_ID)
,role_code INT References APPL_ROLE(role_code)
,[active_ind]
)

-- For Super Admin
SELECT aur.userId UserName, au.Login_Key Pwd, au.[user_display_name]
FROM APPL_USER_ROLE aur
JOIN APPL_USER au ON aur.userid = au.LOGIN_ID
WHERE role_code = 1


Refer this link for role-based Menus
http://forums.asp.net/t/1616659.aspx

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Webmasters964, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Webmasters964 on: 8/28/2013 [Member] Starter | Points: 25

Up
0
Down
Dear i have only master page Login page Redirect Default page open Super Admin login all menu/submenu show and Admin login Admin,user menu/submenu show then user login only user menu/submenu show only one master page

Webmasters964, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bandi on: 8/28/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
For this list of menus & Submenus..
? Show all Menu and Submenu 

Menu Admin (ul)
? Submenu (li)
o Home
o Report
o Profile
o About
Menu User (ul)
? Submenu (li)
o Home
o Profile


I'm providing DB Structure only....
CREATE TABLE APPL_MENU 

(
APPL_MENU_ID INT IDENTITY PRIMARY KEY,
MENU_NAME VARCHAR(30) NOT NULL,
PARENT_MENU_ID INT REFERENCES APPL_MENU(APPL_MENU_ID),
)


APPL_MENU_ID MENU_NAME PARENT_MENU_ID
----------- ---------- ------------
1 SuperAdmin NULL
2 Admin NULL
3 User NULL
4 Home 2
5 Report 2
6 Profile 2
7 About 2
8 Home 3
9 Profile 3

CREATE TABLE APPL_ROLE_MENU(
role_code INT REFERENCES APPL_ROLE(role_code) -- Refer APPL_ROLE table in the previous post
,[menu_id] INT REFERENCES APPL_MENU(APPL_MENU_ID)
,[landing_menu_ind] CHAR(1)
,[read_only_ind] CAHR(1)
)

role_code Menu_id
1 1
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
2 4
2 5
2 6
2 7
3 8
3 9


Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Webmasters964, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bandi on: 8/28/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
Follow the above DB structure and refer the link below to make invisible some of MENUs/SubMenus in the master page
http://stackoverflow.com/questions/10213101/making-menu-items-invisible-from-on-the-master-page?rq=1


The following link might help you
http://msdn.microsoft.com/en-us/library/ehszf8ax(v=vs.100).aspx

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Webmasters964, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response