G
Guest
Hello all, can someone please be my second pair of eyes! I'm getting the
above error at line: for(int i = 0; i <= dlstScope.Items.Count-1; i++).
My code's below: (dlstScope is a nested dlstScope in a repeater). Thanks all.
private void butSave_Click(object sender, System.EventArgs e)
{
DataList dlstScope = (DataList)myRepeater.FindControl("dlstScope");
for(int i = 0; i <= dlstScope.Items.Count-1; i++)
{
string Answer =
((DropDownList)dlstScope.Items.FindControl("txtAnswer")).SelectedValue;
string WorksheetQuestionID =
((Literal)dlstScope.Items.FindControl("lblWorksheetQuestionID")).Text;
string WorksheetID =
((Literal)dlstScope.Items.FindControl("lblWorksheetID")).Text;
Action(WorksheetQuestionID, Convert.ToInt32(WorksheetID),
Convert.ToInt32(Answer));
}
}
above error at line: for(int i = 0; i <= dlstScope.Items.Count-1; i++).
My code's below: (dlstScope is a nested dlstScope in a repeater). Thanks all.
private void butSave_Click(object sender, System.EventArgs e)
{
DataList dlstScope = (DataList)myRepeater.FindControl("dlstScope");
for(int i = 0; i <= dlstScope.Items.Count-1; i++)
{
string Answer =
((DropDownList)dlstScope.Items.FindControl("txtAnswer")).SelectedValue;
string WorksheetQuestionID =
((Literal)dlstScope.Items.FindControl("lblWorksheetQuestionID")).Text;
string WorksheetID =
((Literal)dlstScope.Items.FindControl("lblWorksheetID")).Text;
Action(WorksheetQuestionID, Convert.ToInt32(WorksheetID),
Convert.ToInt32(Answer));
}
}