I wrote this coding to select and deselect all items in listbox when click checkbox. Its working well. Thanks to all.
Javascript:
function selectall(cb_selall)
{
if (cb_selall.checked)
{
for(i=0; i<document.form1.li_mana_cards.options.length; i++)
{
document.form1.li_mana_cards.options[i].selected = true;
}
}
else
{
for(i=0; i<document.form1.li_mana_cards.options.length; i++)
{
document.form1.li_mana_cards.options[i].selected = false;
}
}
}
Page Load:
cb_red_inac.Attributes.Add("onclick", "javascriptselectall(this);")