The below code is not working
for (int i = 0; i < ddlHowMany.SelectedIndex ; i++)
{
UserTable.Rows[i].FindControl("(txtSample)+(i)").Visible = true;
}
Plz help me out..
> In the first row of the table it is txtSample1
> The below code is not working
>
> for (int i = 0; i < ddlHowMany.SelectedIndex ; i++)
> {
> UserTable.Rows[i].FindControl("(txtSample)+(i)").Visible = true;
> }
>
> Plz help me out..
First time round, the code is looking for a control called txtSample0 which,
as you have described it, won't exist...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net
I am not able to concatinate txtSample with " i " in the loop.
Any gusses.
Your txtSample was inside brackets and the whole lot was inside quotes, so
you were literally looking for a control called (txtSample)+(i)
--
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available
"iHavAQuestion" <iHavAQ...@discussions.microsoft.com> wrote in message
news:3D777F62-3313-404B...@microsoft.com...
UserTable.Rows[i].FindControl("(txtSample"+(i+1).ToString() ).Visible =
true;
--Peter
"iHavAQuestion" <iHavAQ...@discussions.microsoft.com> wrote in message
news:FBD2DD26-C9A3-4019...@microsoft.com...
(Mind you, it won't actually do anything, as the bracket is inside a quoted
string, but even then, if it is called txtSample1, it won't be found with
(txtSample1 as your string. )
--
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available
"Peter Bromberg [C# MVP]" <pbro...@nospammaam.yahoo.com> wrote in message
news:3518932A-91F1-462F...@microsoft.com...