CheckBox25
CheckBox25 is used to provide selectable options within a form. It lets users enable or disable features, settings or activities with a simple click.
The control automatically binds values to the model based on the ControlId.
Parameters
- ControlId (mandatory)
- The unique name and ID of the checkbox.
- The ControlId must match the model variable name to bind properly.
- Value (mandatory)
- A boolean value that determines whether the checkbox is checked.
- True indicates checked; false indicates unchecked.
- Label (optional)
- The text displayed next to the checkbox.
- Used to describe the purpose of the checkbox.
- IsPostBack (optional)
- A boolean flag that triggers form submission when the user interacts with the control.
- False by default.
Sample Code
string htmlstr = "";
htmlstr += CheckBox25.GetHtml("IsActive", Model.IsActive, "Is Active", false);