Solved

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

Posted on 2014-11-06
1
176 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

770 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