Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2013-05-17
5
Medium Priority
?
1,552 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 29

Accepted Solution

by:
Kumaraswamy R earned 2000 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

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

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

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

721 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