By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,968 Members | 1,620 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,968 IT Pros & Developers. It's quick & easy.

checkbox in datalist

P: 23
i have checkbox in datalist and i need to find which checkbox is checked
name of checkbox = CheckBox1
and name of datalist is DataList1

i am writng this code to find the checked checkbox
Expand|Select|Wrap|Line Numbers
  1. foreach (DataListItem dli in DataList1.Items)
  2. {
  3.  
  4. bool ok = ((CheckBox)dli.FindControl("CheckBox1")).Checked;
  5. if (ok)
  6. {
  7. // ok 
  8. }
  9. }
  10.  
but the result is always false what i have to do


10x
Oct 16 '07 #1
Share this Question
Share on Google+
4 Replies


jhardman
Expert 2.5K+
P: 3,405
moved to .NET forum.

Does "10x" refer to strength or size?
Oct 17 '07 #2

Frinavale
Expert Mod 5K+
P: 9,731
i have checkbox in datalist and i need to find which checkbox is checked
name of checkbox = CheckBox1
and name of datalist is DataList1

i am writng this code to find the checked checkbox
Expand|Select|Wrap|Line Numbers
  1. foreach (DataListItem dli in DataList1.Items)
  2. {
  3.  
  4. bool ok = ((CheckBox)dli.FindControl("CheckBox1")).Checked;
  5. if (ok)
  6. {
  7. // ok 
  8. }
  9. }
  10.  
but the result is always false what i have to do


10x
Is this a desktop application or an asp.net application?

-Frinny
Oct 17 '07 #3

P: 23
Is this a desktop application or an asp.net application?

-Frinny
no this is a asp application and i am moving this question to asp form but no replys till now

if u can help me

10xxxxx
Oct 19 '07 #4

jhardman
Expert 2.5K+
P: 3,405
no this is a asp application and i am moving this question to asp form but no replys till now

if u can help me

10xxxxx
if 1x means extra large, then 10xxxxx must mean realy really big!

umm. maybe I misunderstood you. When you say an asp application, which version do you mean? Is this classic ASP or ASP.NET? generally there is nothing in classic ASP referred to as a datalist and you can't write classic ASP with C or C++ or C#, so that's why I moved this to .NET in the first place.

Jared
Oct 19 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.