Please if you have an idea, then tell me.


Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Mar 20, 2011, 4:57 AM
Vikas AhlawatPosted Mar 20, 2011, 11:18 PM
Thanks for your replies
Suthish NairPosted Mar 20, 2011, 11:40 AM
TextAlign="Right" runat="server">
using System.Collections.Generic;
protected void Button1_Click(object sender, EventArgs e)
{
//IEnumerable
// where item.Selected
// select item.Text;
IEnumerable
where item.Selected
select int.Parse(item.Value);
Response.Write("Selected Value/Text
");
foreach (var item in allChecked)
{
Response.Write(item + "
");
}
allChecked = null;
}
Vikas AhlawatPosted Mar 20, 2011, 2:43 AM
I m also using this checkboxs list.
but i want to know that, if no list item is selected the
we don't need to run this for loop.
Amit ChoudharyPosted Mar 19, 2011, 7:45 AM
i received that you have marked it as answer but it didn't try again as a favour back ;))
Thanks.
Amit ChoudharyPosted Mar 16, 2011, 8:19 AM
There's a control named CheckBoxList in asp.net. you can use it for getting all the checked and unchecked items.
intialize it by any collection
you can initialize it at runtime also
ListItem liTemp = new ListItem("Test","01");
checkboxlist1.Items.Add(liTemp);
and use the below code to get the checked items
//This event will help you to only get the values when the any checkbox is checkedVikas AhlawatPosted Mar 16, 2011, 8:04 AM
Keyexecutive can be more then one
like this
http://www.fundoodata.com/products/advance_search.php
VulpesPosted Mar 16, 2011, 5:18 AM
RadioButtons which are all within the same container (for example the form itself, a panel or groupbox) act together as a group - when you check one, the others automatically uncheck.
See here (http://msdn.microsoft.com/en-us/library/system.windows.forms.radiobutton.aspx) for further details.
If you put the RadioButtons in an array, then you could iterate through them using a for loop to see which one is currently checked.This is not as much code as examining each one individually.