Just a quick note and quick fix. I have a Repeater control with both Header, Item and Footer templates in one of my ASP.NET 2.0 projects. This control is rendering contextual site navitagion to ul/li structure. Sometimes this navigation is simply empty and i needed some easy way (preferably declarative) to hide Header and Footer templates when the datasource is empty because they were still beeing rendered.
To my knowledge, there is no property on Repeater control that i could for such behaviour so i solved my problem with this little trick. I'm using the Visible property of Repeater control and hiding it when there are no data in the datasource available.
4: Visible="<%# Repeater1.Items.Count > 0 %>"
7: <h2>Contextual Links</h2>
8: <ul class="menublock">
13: href='<%# Eval("[navigateurl]") %>'><%# Eval("Title") %></a>
Is there some straight way how to do this declaratively in ASP.NET 2.0? I tried google search but didn't find anything usefull.