Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public ActionResult Index() {
- // IsUserAnEditor is a placeholder for a method to determine whether the user
- // is an editor based on whatever role technology you're using.
- MyModel model = new MyModel { IsEditor = IsUserAnEditor() }
- return View(model);
- }
- @model MyModel
- ....
- @if(Model.IsEditor)
- {
- // Code to add the "Edit" link, this is just an example, customize for your needs
- <span>
- @Html.ActionLink("Edit", "Edit", "MyController", new { id=Model.ID })
- </span>
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement