9. Click the Logout link in the footer again and go to the Login page. Log in with an account you
created earlier in this chapter that is not a member of the Managers role. Go to the Gig Pics page
again, select an album from the list and click the Edit Photo Album link. This time, you don’t see
Delete buttons, because the account you’re logged in with is not assigned to the Managers role. In
the next chapter you see how to modify this page once more to also let owners of an album delete
their own pictures. In addition, you’ll see how to hide the Edit Photo Album link for users without
edit permissions.
How It Works
Most of the code in this exercise shouldn’t be new to you. You have seen how you can delete items
with the EntityDataSource and ListView controls. You also learned how to handle events such as
ItemCreated (that fires for each item that is shown in the ListView control) and search for controls in
an item using FindControl.