Solved

How to I hide some link based on the type of user that I'm login.

Posted on 2014-11-06
1
177 Views
Last Modified: 2014-11-10
I have a set of link that I will have to hide based on my window authentication. How do I do this? These link are from my grid. I will like to hide them if I'm a user x or show them if I'm a user y.

   @Html.ActionLink("Edit", "Edit", new { id=item.RecordID }) |
                        @Html.ActionLink("Details", "Details", new { id=item.RecordID }) |
                        @Html.ActionLink("Delete", "Delete", new { id=item.RecordID })

Open in new window


I use this for my window Authentication

[Authorize(Users = @"xxx/xx")]
Under my controler
0
Comment
Question by:yguyon28
1 Comment
 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 total points
ID: 40428661
Are these links in a group?  You could put the links in a <div> and apply a CSS style for display:none.

Another approach would be to add logic to the view, and not render the links for that condition.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Jquery datatables integration with ASP.NET MVC, bootstrap 3 23
Convert Select to DropDownListFor MVC 5 2 31
How to read text with RegEx... 2 25
asp.net mvc 2 25
Having just graduated from college and entered the workforce, I don’t find myself always using the tools and programs I grew accustomed to over the past four years. However, there is one program I continually find myself reverting back to…R.   So …
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
The viewer will learn how to implement Singleton Design Pattern in Java.
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

830 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