So I have a composite paging control that shoulld be positioned on the page
like this:
PagNav
ResultSetDisplay
PagNav
I know that I can't resuse the PagNav more than once in the form, so I
instantiate a couple of instances, PagNavTop and PagNavBottom, and thus I
end up with:
PagNavTop
ResultSetDisplay
PagNavBottom
The paging navigators are composed of a bunch of dynamically generated
LinkButtons and Lables. And since they should appear on the page
identically, I don't want to do the extra dynamic control creation and
calculation for the bottom one. I thought I might just re-use the same
LinkButtons and Labels in both top and bottom.
Alas, the ASP.NET framework boobytraps the dynamic controls if they're added
to another control ini the same form. Once I add them to PagNavBottom --
after adding them to PagNavTop -- they vanish from PagNavTop and will only
show up in the last parent they've been added to, PagNavBottom.
It's waste of processor cycles and memory to recreate a brand new set of
controls to each parent. I'm pretty sure that many people here in this group
have bumped into this issue, and I appreciate your feedback on how you'd
attack such a problem.
Homam