c# - How can I programatically assign a MaxLength to a dynamically created CheckBox? -
on sharepoint webpart (in .ascx.cs file), i'm conditionally creating various controls/elements programatically, e.g.:
checkbox ckbxemployeeq = new checkbox { cssclass = "dplatypus-webform-field-input", id = "ckbxemp" }; ckbxemployeeq.text = "employee?"; ckbxemployeeq.width = 80; i want able set maxwidth property, neither available way:
checkbox ckbxemployeeq = new checkbox { cssclass = "dplatypus-webform-field-input", id = "ckbxemp", maxlength = 12 }; ...nor way:
checkbox ckbxemployeeq = new checkbox { cssclass = "dplatypus-webform-field-input", id = "ckbxemp" }; ckbxemployeeq.text = "employee?"; ckbxemployeeq.width = 80; ckbxemployeeq.style.maxlength = 12; how can accomplish it?
update
wow, dumb question (yes, there dumb questions - @ least one, anyway)! in fact, poster child "tbyp" (think before post). want set width , maxlength of textbox affected state of checkbox. , following work:
boxssnoritin = new textbox { cssclass = "dplatypus-webform-field-input", id = "txtbxssnoritin", width = 80, maxlength = 12 }
Comments
Post a Comment