Hi
TextBox preTestMarks = (TextBox)item.FindControl("txtPreTestMarks");
preTestMarks.Text = objResult.PreTestMarks;
Thanks
Hi
TextBox preTestMarks = (TextBox)item.FindControl("txtPreTestMarks");
preTestMarks.Text = objResult.PreTestMarks;
Thanks
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Jignesh KumarRank #91 · 22.9K reputationPosted Sep 20, 2022, 12:49 AM EDT
Hi Ramco,
Please use this one,
TextBox preTestMarks = (TextBox)item.FindControl("txtPreTestMarks"); preTestMarks.Text = Convert.ToString(objResult.PreTestMarks);;Sachin SinghRank #66 · 26.2K reputationPosted Sep 20, 2022, 12:56 AM EDT
Most probably, PreTestMarks property is of int type, so you need to convert it to string before assigning it to textbox control.
TextBox preTestMarks = (TextBox)item.FindControl("txtPreTestMarks"); preTestMarks.Text = Convert.ToString(objResult.PreTestMarks);