Click here to Skip to main content
16,005,734 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm facing in ASP.NET application (using .NET 4.0/VS.NET 2010) an issue as described below

Issue Description:
We have a ASPX page (GenericResultSummary.aspx) that contains a left bar and result summary that appears in the right pane (right of the left bar). Now the left bar is itself composed of a User Control names BasicFilter.ascx. This user control displays a list of filters by Category. The left bar looks as below:

Basic Filters

Primary Care Physician
--- Item 1
--- Item 2
--- Item 3
--- Item 4
--- Item 5
+ (more)

Languages Spoken
--- English
--- Spanish
--- Portuguese
--- Chinese (Mandarin)
--- Russian
--- Italian
--- Polish
--- Hebrew
--- French
--- Greek
- (less)

Advance Filters


The requirement is that if the list has more than 5 items then we need to display only top 5 filters and show a more link. On clicking this link all the items in the list will be displayed and a less link will also appear as shown above.

Now we are able to display the items in the list but we aren’t able to get the more/less link displayed. The list gets dynamically binded to a Repeater Control and this is where we are facing issue to display the more/less link. Also on clicking of the more link, the whole page should not be refreshed and we should not be hitting the DB to repopulate the list to show more items. Basically the more link should act as a toggle to display more items and collapse to display top five items when less link is clicked.

Has anybody done something similar before in ASP.NET applications?? Any pointers will be of great help.

Thanks in advance.
Debsoft
Posted

1 solution

Now we are able to display the items in the list but we aren’t able to get the more/less link displayed. The list gets dynamically binded to a Repeater Control and this is where we are facing issue to display the more/less link.

Add more less link after the repeater

Also on clicking of the more link, the whole page should not be refreshed
Try using an UpdatePanel

and we should not be hitting the DB to repopulate the list to show more items.
Try loading the complete list from DB and save the result in a session variable. Pick the required items from that list

Regards
Espen Harlinn
 
Share this answer
 
Comments
debsoft75 6-Jan-11 3:37am    
Hi Espen,

Thanks for your time to answer the query. The issue here is we have multiple such Categories of Basic Filters and the more/less link applies to all these categories. So if I store the list collections for each of the categories in a session variable, is that a viable solution.
Thanks

Debsoft
Espen Harlinn 6-Jan-11 3:43am    
Suggestion: Create a Dictionary<string,list<filter> > where the dictionary key is the category

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900