We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

Is it possible to create textbox dynamically?

Raul77
Raul77 asked
on
Medium Priority
259 Views
Last Modified: 2013-12-17
Hi,
i would like to create textbox based on how many items i have in my arraylist. is it possible? so like if i have 5 item there should only be 5 box or if i have 10 should only be 10. etc... is it possible?i tried creating box like this as a test:

        TextBox newbox = new TextBox();
        newbox.ID = "newbox";
        newbox.Text = "hi";
        newbox.TextMode = TextBoxMode.MultiLine;
        this.Controls.Add(newbox);

but it gives an error since i didnt add the label in my aspx file, but i dont know how many boxes i will have to add there. is what i am doing possible?

Thanks.
Comment
Watch Question

Anurag ThakurTechnical Manager

Commented:
yes you can definitely create dynamic text boxes
look at the following link from microsoft
http://support.microsoft.com/kb/317794

Author

Commented:
thanks but the code is if you know how many box you will have, can you show me a simple example if you dont know how many text boxes you will have?
Thanks
Senior Developer
CERTIFIED EXPERT
Commented:

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

Commented:
Thanks.
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.