.net – Controlling ASP .Net repeater control output height


I'm currently implementing an RSS feeder control for a website. I'm planning to allow a limit of 10 items to be displayed on the homepage using a repeater control.

My question is how do I prevent the height of the control exceeding a certain dimension? I cannot guarantee how much content will be provided per RSS feed item.

One option I have considered is to limit the volume of content per item as a substring of the content but this is still providing a general approach.

Is there a way to determine how far down the page the control has renderred per control on the server side and abandon further binding once it has reached a limit? Or is the better approach to always render the 10 items then on page load check with javascript how much room each item takes up as a running total and hide anything after a limit?



Best Solution

Add a div tag (or other appropriate block-level element, as you may already be using something like 'table') the the Header and Footer templates of the control, and use css to style the height and overflow of this element.

Related Question