More in this section

Forums / Developing with Sitefinity / Get number of users in each role (User Administration)

Get number of users in each role (User Administration)

1 posts, 0 answered
  1. Chanan Zass
    Chanan Zass avatar
    123 posts
    21 Aug 2012
    14 Aug 2012
    Link to this post
    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: -- 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>--%>

    <sitefinity:GenericCollectionBinder ID="rolesBinder" runat="server"
            DataMembers="Name, UsersInRole, ProviderName, Id, ProviderTitle"
                <sitefinity:BinderContainer runat="server" RenderContainer="false" TemplateHolderTag="UL"
                        <a id="roleCommand" sys:href="javascript:void(0);" class="editCommand">{{Name}}{{ProviderTitle}}</a> <%--<span class="sfCount">({{Number(UsersInRole)}})</span>--%>

    However, the expression {{Number(UsersInRole)}}
    produces 0 (zero).

    Is UsersInRole DataMember not included yet in the collection?

    Any help would be most welcome.
    P.S. I should mention that the edited template has been registered in Administration -- Settings -- Advanced -- Controls -- ViewMaps

1 posts, 0 answered