Get number of users in each role (User Administration)
We're trying to get in Sitefinity 5.1 the same features available in Sitefinity 3.7. In this case, when managing users and viewing the list of roles in the right column, we'd like to display the number of users in each role group.
As mentioned this was offered by default in Sitefinity 3.7.
We've tried using the template available in the SDK:
WidgetTemplates.zip -- Backend -- Security -- Principlas -- UsersCommandPanel.ascx.
We uncommented the following commented strings:
<
div
class
=
"sfAllFilter sfRolesFilter"
>
<
asp:LinkButton
runat
=
"server"
ID
=
"cmdLoggedInUsers"
CommandName
=
"LoggedInUsers"
Text="<%$ Resources:Labels, FilterLoggedInUsersText %>"
OnClientClick="LoggedInUsers(this);return false;" ></
asp:LinkButton
>
<%--<
span
class
=
"sfCount"
ID
=
"LoggedInCount"
>(0)</
span
>--%>
</
div
>
<
sitefinity:GenericCollectionBinder
ID
=
"rolesBinder"
runat
=
"server"
TargetId
=
"rolesList"
ServiceUrl
=
"~/Sitefinity/Services/Security/Roles.svc"
BindOnLoad
=
"true"
OnClientItemEditCommand
=
"rolesBinder_EditItemCommand"
OnClientDataBound
=
"rolesBinder_DataBound"
OnClientItemDataBound
=
"rolesBinder_ItemDataBound"
DataKeyNames
=
"Name"
DataMembers
=
"Name, UsersInRole, ProviderName, Id, ProviderTitle"
>
<
Containers
>
<
sitefinity:BinderContainer
runat
=
"server"
RenderContainer
=
"false"
TemplateHolderTag
=
"UL"
>
<
li
>
<
a
id
=
"roleCommand"
sys:href
=
"javascript:void(0);"
class
=
"editCommand"
>NameProviderTitle</
a
> <%--<
span
class
=
"sfCount"
>(Number(UsersInRole))</
span
>--%>
</
li
>
</
sitefinity:BinderContainer
>
</
Containers
>
</
sitefinity:GenericCollectionBinder
>