TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
neel k
NA
143
136.4k
Show & hide the links based on the loggedin user role in MVC
Mar 17 2015 4:32 PM
Hi
I am using MVC 5, I need to show and hide the links based on the logged in user role.
view code
if (User.IsInRole("Admin"))
{
<td style="text-decoration:underline">
@Html.ActionLink("Manage Users", "ManageUsers", new { id = Model.id, appname = Model.app_name })
</td>
}
controller code
[HttpPost]
[Authorize(Roles = "Admin")]
public ActionResult ApplicationEdit()
{
//////////////
}
hide the link when I logged in as a normal user, it works perfectly. But when I logged in as Admin it is not showing the link. hide the link both time. my requirement is hide the link only when logged in as a normal user not Admin.
Reply
Answers (
1
)
How to use VB6 dll in asp.net application and IIS
Make a search engine in asp.net mvc 4 with Ajax (Or not Ajax