0

this is my code::

TextBox[] tbArray = new TextBox[] { TextBox1, TextBox1, TextBox1 };


                for (int j = 0; j < tbArray.Length ; j++)
                {
                  
                        tbArray[j].Visible = true;
                     
                }

this code is success but only one textbox show not three textbox.. Can any one help me. Thanks

3
Contributors
2
Replies
4
Views
7 Years
Discussion Span
Last Post by bhavu4u
0

Check this in Page_Load event

if (!IsPostBack)
        {
            for (int i = 0; i < 3; i++)
            {
                TextBox txt = new TextBox();
                txt.ID = "txt" + i.ToString(); //or "txt" + pnlview.Controls.Count.ToString();
                pnlview.Wrap = true;
                pnlview.Controls.Add(txt);
                pnlview.ScrollBars = ScrollBars.Both;
            }
        }
0

#
write this
TextBox[] tbArray = new TextBox[] { TextBox1, TextBox2, TextBox3 };
#
#
instead of
TextBox[] tbArray = new TextBox[] { TextBox1, TextBox1, TextBox1 };
#

Edited by bhavu4u: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.