Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Paul Blair 466 posts 731 karma points
    May 11, 2009 @ 07:00
    Paul Blair
    0

    Adding Member Count

    Hi,
    I would like to know if there is a better way of achieving this:

    Requirement:
    Add a member count to the search functionality within the members section of Umbraco.

    What I did:
    - Grabbed umbraco\presentation\umbraco\members\search.aspx.cs from the umbraco source
    - copied into a new class file in appcode
    - Changed the namespace so it wouldn't clash with the compiled version
    - Create a running total on the itemDataBound Event:
    [code]
    protected void umbMember
    OnItemDataBound(object sender, DataGridItemEventArgs e)
    {
    if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
    iMemberCount++;
    }
    [/code]
    - some minor modifications to the rest of the class to reset and display the counter
    - change name space on umbraco/members/search.aspx to the new namespace, add a label and bind the OnItemDataBound event

    Now this all feels like a bit of a hack and also might break the next time I upgrade Umbraco.

    Does anyone have any other ideas on how to achieve this?

    Cheers
    Paul

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies