Dec 04
Building an ASP.NET site, I needed to use a server-side CheckBoxList control. Much to my irritation, the server control output each <input type="checkbox" /> in a tr of a table containing the entire list. I thought, how awful!
Fortunately, I found a way for the server control to quickly output each input in spans rather than table rows: CheckBoxListId.RepeatLayout = RepeatLayout.Flow
The default value is RepeatLayout.Table. Now my checkboxes are cooler.
Popularity: 6% [?]









December 5th, 2008 at 10:31 am
Cool tip. I remember when working with coldfusion, there were various controls to handle select dropdowns, as well as other form elements, and looking back, I wish I had exercised more customization to get them to output the way I really wanted.
Then again, I’m a lot more particular now than I was then.
If I ever start using ASP.NET, tips like these would be bookmarked.
December 5th, 2008 at 11:58 am
I usually keep server controls at bay with a ten foot pole where I can, which is doable in ColdFusion, since a ColdFusion post still returns the HTML controls along with the CF controls.
However, if you want to access an ASP.NET input of any type in codebehind, you must have them be server controls, which is eternally frustrating since so many ASP.NET controls output gobbleygook HTML. Sigh.
So, yes, I’m with you – anything to make the control less nasty is going to be entered into a blog entry from now on. I’m tired of dealing with gobbleygook, and I’m tired of creating site that rely on jQuery for ajax posts. I want to have a server-side post fallback!