If you’re used to .net server controls, you’ll probably want to set the checked property on a checkbox control to true. Well that won’t work.
It displays either checked or not checked depending on whether the string checked is one of its attributes.

Here is a way to make it happen in a templated column in a datagrid in old-school .net 1.1:

a) the line must be either the
string "checked" (without the quotes), or nothing at all. You cannot set checked=1, or checked=true, etc.
b) NOTE - we don't have quotes around the stuff, so you can not edit the page in design mode

2) therefore we convert the boolean to a string with a case statement when we do the database query:
(also take care for isNull)
CASE isNull(isHomeUse, 0)
WHEN 1 THEN 'checked'
ELSE ''
END AS isHomeUse

Note: I’m not so good at getting the Eval syntax to work. I don’t like returning an html string from my sql query, but at least this way works. I’d be interested in hearing from someone who can improve on this.
But I won’t hold my breath, since this code seems so 2002.

I ended up not using this yet, but it returns a dictionary collection of all controls contained in a page, for example, and their current value. This includes textboxes, dropdowns, radios, and checkboxes.
I usually credit the original source for functions like these, but I lost where the recursive sub came from
' **************************************************************************
' purpose: function to call the recursive sub and then return the dictionary containing the results
Public Shared Function get_all_controls(ByVal container As Control) As Hashtable
htControls.Clear()
Dim strTemp As String = container.ID & " " & container.ClientID
strTemp = strTemp + container.UniqueID + " " + container.Page.Title
Diagnostics.Debug.Print(strTemp)
get_all_controls_recursive(container)
Return htControls
End Function

I made a user control, and I wanted to add a ctl_Width property and apply the value to all the contained sub-controls.
But setting the “Width” property of each did not work – I had to change the style of each. So I made some functions to help me in setting the style attribute of each of the sub controls contained in my user control. Here are the functions: