Is there a way for me to make a link appear on an MVC2 page based on a condition (to be exact, whether a user is in a role?)
UPDATE: some more information
Generally speaking I don’t have anything yet… I was just wondering what the best way to go about doing this was…
I want the link to show up here in the site.Master
<ul id="menu">
<%
if(true){}
%>
<li><%: Html.ActionLink("Home", "Index", "Home")%></li>
<li><%: Html.ActionLink("View Your Populations", "PopulationInfo", "PatientACO")%></li>
</ul>
You will need to create a Model for each page view that has a
UserIsInRoleproperty (or whatever), and then you just check it and show the link based on that.EDIT:
ViewModel:
Controller:
View: