G
Guest
h
How do i get an asp checkBoxList to emit client script. I want it so that when each checkbox is clicked, i can cause some action to happen
i tried
CheckBoxList cbl = new CheckBoxList()
for(int i = 0; i < 5; i++
ListItem li = new ListItem(i.ToString(), i.ToString())
li.Attributes.Add("onclick", string.Format("alert('{0}')", i.ToString()))
cbl.Items.Add(li)
but no onclick attribute is emitted to the page
Am i doing it wrong, or is there a way around this
Ada
How do i get an asp checkBoxList to emit client script. I want it so that when each checkbox is clicked, i can cause some action to happen
i tried
CheckBoxList cbl = new CheckBoxList()
for(int i = 0; i < 5; i++
ListItem li = new ListItem(i.ToString(), i.ToString())
li.Attributes.Add("onclick", string.Format("alert('{0}')", i.ToString()))
cbl.Items.Add(li)
but no onclick attribute is emitted to the page
Am i doing it wrong, or is there a way around this
Ada