Start by passing the ID of the checkbox list to the
addToCheckBoxListList
function, rather than passing the element itself:
function BindCheckboxlist(_txt1, _txt2) {
var CHK = "<%=chklist.ClientID%>";
addToCheckBoxListList(CHK, 'abc', 'abc');
}
You'll need to check whether the control actually renders a surrouding element. If it doesn't,
document.getElementById
won't find anything.
Also, the server-side control won't know anything about the values you've added via Javascript. You'll have to read the
Request.Form
collection to read the values from them.