Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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 …
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…
This video teaches viewers about errors in exception handling.
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.

929 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now