How to read selected checkbox list value from HTML page ?

Posted by Gg under ASP.NET on 7/21/2011 | Points: 10 | Views : 2200 | Status : [Member] | Replies : 2
Hi,

How to read selected checkbox list value from HTML page ?'

Thanks
gg.




Responses

Posted by: Neha-kapoor on: 7/21/2011 [Member] Starter | Points: 25

Up
0
Down
hallo
clear ur query really what u want

thanks

Gg, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: RaviRanjanKr on: 7/24/2011 [Member] Starter | Points: 25

Up
0
Down
Try to run explore demos at given link
http://www.w3schools.com/aspnet/showasp.asp?filename=demo_checkboxlist
or you can use given standard code to list out all selected values from Checkbos list in Asp.Net

private Int32[] CheckboxListSelections(System.Web.UI.WebControls.CheckBoxList list)

{
ArrayList values = new ArrayList();
for (int counter = 0; counter < list.Items.Count; counter++)
{
if (list.Items[counter].Selected)
{
values.Add(list.Items[counter].Value);
}
}
return (Int32[])values.ToArray(typeof(Int32));
}


Thanks
Ravi Ranjan Kumar
http://raviranjankr.wordpress.com

Gg, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response