StringBuilder _StrResult = new StringBuilder();
_StrResult.Append("<root>");
foreach (TextBox txt in pnlInterview.Controls)
{
foreach (Label lbl in pnlInterview.Controls)
{
Label lblLevel = (Label)pnlInterview.FindControl("lbl");
TextBox txtInterviewRound = (TextBox)pnlInterview.FindControl("txt");
_StrResult.Append("<InterviewLevel>");
_StrResult.Append("<level>" + lblLevel.Text.ToString() + "</level>");
_StrResult.Append("<RoundName>" + txtInterviewRound.Text.ToString() + "</RoundName>");
_StrResult.Append("</InterviewLevel>");
}
}
_StrResult.Append("</root>");
return _StrResult;
Unable to recognize where it went wrong
I am unable to access oftype(<Textbox>)
at starting foreach loop only I am receiving this error
any help is appreciated