View Single Post
  #1 (permalink)  
Old July 5th, 2010, 11:39 AM
lstew452 lstew452 is offline
Authorized User
Join Date: Jun 2010
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 16:Page 615 try it out Checking Roles with IsUserInRole at Runtime

Step 8. The Delete Button does not show. Please advise Larry


Protected Sub ListView1_ItemCreated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.ListViewItemEventArgs) Handles ListView1.ItemCreated
Select Case e.Item.ItemType
Case ListViewItemType.DataItem
Dim deleteButton As Button = CType(e.Item.FindControl("DeleteButton"), Button)
deleteButton.Visible = Roles.IsUserInRole("Managers")
End Select
End Sub


User: Manger

I checked the Web Admin:

User ID:
E-mail address Active user

Select roles for this user:

This proves the user is set to manager.