Solved

ASP.Net MVC 4 C# -- role based menu items ?

Posted on 2013-05-17
5
1,137 Views
Last Modified: 2015-05-21
I read some of the below articles and want the easiest
way to implement "role based menu items" that appear
in "_Layout.cshtml"
  ** http://techbrij.com/role-based-menu-asp-net-mvc
  ** http://www.fluentsecurity.net
  ** http://forums.asp.net/t/1761556.aspx/1
  ** http://nugetmusthaves.com/Tag/membership

What do you recommend since before I start creating this APP ?

Steps
 1. New Project
 2. ASP.Net MVC 4 C#
 3. Basic, Razor
 4. add users via VS2010 WSAT (easy, I like this security)
 5. run app
 6. works
 7. change below _Layout.cshtml

                    <nav>
                        <ul id="menu">
                            <li>@Html.ActionLink("Home", "Index", "Home")</li>

                            [Authorize(Roles = "Administrator")]
                            <li>@Html.ActionLink("About", "About", "Home")</li>

                            [Authorize(Roles = "Everyone")]
                            <li>@Html.ActionLink("Contact", "Contact", "Home")</li>
                        </ul>
 8. run app
 9. get attached failure --> should HIDE About and Contract buttons since not logged in
0
Comment
Question by:finance_teacher
  • 2
5 Comments
 
LVL 29

Accepted Solution

by:
Kumaraswamy R earned 500 total points
ID: 39186589
0
 

Author Comment

by:finance_teacher
ID: 39192066
Do you have any other websites talking about this ?
0
 

Author Comment

by:finance_teacher
ID: 39200055
Please reply.
0
 
LVL 19

Expert Comment

by:Amandeep Singh Bhullar
ID: 40790596
I've requested that this question be deleted for the following reason:

Not enough information to confirm an answer.
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question