Solved

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

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
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 goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

708 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

10 Experts available now in Live!

Get 1:1 Help Now