1
Vote

DataListAdapter - Renders container despite empty item collection.

description

When the DataList contains no items, it shoudn't render anything.
 
At the moment it still renders the outer container and an empty table.
 
At the moment, the work around is to hook into the DataList.PreRender event and check the item count and if so add AdapterEnabled = "false" to the list's Attributes collection.

comments

genbox wrote Dec 10, 2009 at 12:15 AM

See patch #4611 here: http://cssfriendly.codeplex.com/SourceControl/PatchList.aspx
It fixes this bug in a different manner than described by issue report creator. It checks the item count inside the adapter and only renders start or end tags together with the content, if the item count is higher than 0.

genbox wrote Dec 11, 2009 at 1:16 AM

There is an update to patch #4611 called #4623