I want to display an Admin ActionLink on my homepage if a user's role is 'Admin'. I have managed to get the roles configured correctly but I'm unsure how to do it.
So far I have implemented the following code into my HomeController:
Function Admin() As ActionResult
If Roles.IsUserInRole("Admin") Then
Return View("Admin")
Else
Return View()
End If
End Function
I have then implemented the following ActionLink into my Site.Master:
<li><%: Html.ActionLink("Admin", "Admin", New With {.Controller = "Home"})%></li>
I know this isn't correct but it's not something I've done before so I'm not too sure how it can be implemented correctly.
Thanks for any help.