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 umbMemberOnItemDataBound(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?
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 umbMemberOnItemDataBound(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
is working on a reply...
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.