G
Guest
Hi,
I display a repeater in a web page, when i click on the next button, I want
to loop thru the repeater to detect the checkbox controls. Previously this
code works, but now .... I used the debugger n found that the program cannot
even detect the repeater control coz it just skips past this line. I have
listed a abbrev. version of my code below:
private void btnNext_Click(object sender, System.EventArgs e)
{
tstdAnswer = "";
try
{
foreach(RepeaterItem r in MyRepeater.Items) <----
{ for (int i=1; i<=6; i++) { //6 checkboxes
CheckBox chk = (CheckBox)r.FindControl("chkbox"+ i);
if(chk.Checked == true)
{
tstdAnswer += "1";
}
else
tstdAnswer += "0";
}
}
}
}
TIA.
Andrew.
I display a repeater in a web page, when i click on the next button, I want
to loop thru the repeater to detect the checkbox controls. Previously this
code works, but now .... I used the debugger n found that the program cannot
even detect the repeater control coz it just skips past this line. I have
listed a abbrev. version of my code below:
private void btnNext_Click(object sender, System.EventArgs e)
{
tstdAnswer = "";
try
{
foreach(RepeaterItem r in MyRepeater.Items) <----
{ for (int i=1; i<=6; i++) { //6 checkboxes
CheckBox chk = (CheckBox)r.FindControl("chkbox"+ i);
if(chk.Checked == true)
{
tstdAnswer += "1";
}
else
tstdAnswer += "0";
}
}
}
}
TIA.
Andrew.