Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2013-05-17
5
Medium Priority
?
1,654 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
4 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

773 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