HtmlInputCheckBox Control

I have a web page which populates various controls (HtmlInputTextBox, HtmlInputSelect, HtmlInputCheckBox, etc.) into htmlcells of an htmltable. The user can modify these controls and then click a "Save" link. This Save routine goes and finds all the controls, gets the value/setting of the control, and then saves the results to a database.

I use the command "Page.Request.Form[controlName]", where "controlName" is the name of the control, to retrieve the value. However, sometimes the HtmlCheckBoxControl is returned as "null" as if it isn't found. I noticed this happens after the checkbox is unchecked by the user.
[632 byte] By [bsaucer] at [2007-11-20 9:20:22]
# 1 Re: HtmlInputCheckBox Control
Request.Form is an array of values sent back by the browser through a POST request (just as Request.QueryString holds values sent through the path after the question mark).

An unchecked checkbox should not have its value submitted to the server, so you're seeing the correct behavior. Basically what you need to do is to assume that the checkbox is not checked when it is not included with a submitted form.
andreasblixt at 2007-11-9 11:53:34 >