Custom ASP.Net Server Control Issue
Posted on 2008-10-02
I have a asp.net server control that I have written, that display a ordered or unordered list that can contain a number of list items. The developer can determine the through properties to set the number of initial items to display when the controls are invoked the firstime on the web form. For example, there are 10 items, the developer says 5 should show and 5 should remain hidden.
The issue is, when the page refreshes, because of the current design, the controls revert back to their initial items to display property.
I'm struggling with the best way to handle some sort of viewstate that the pages remembers the last number of items the user had exposed before the page refreshed or when they return back to it. The other thing to consider is that the list can also be a static text or even a hyperlinked list of items.
So I need to figure out how to communicate the present items count back to the control so when it redisplays the same number.
Any thoughts on how this should be handled in the real world asp.net server control?