Click here to Skip to main content
15,881,803 members
Please Sign up or sign in to vote.
3.40/5 (2 votes)
How to add textbox's dynamically Give me examples of it and test demo with validation
Posted
Updated 14-Feb-15 1:04am
v2
Comments
Nitij 18-Feb-15 5:46am    
Not that I don't want to answer, but your question is so common that you just need to give a minute of your life to search many good solutions on google/bing or whatever search engine you use instead of asking cp members for demo code WITH validations.

Use this syntax at ur codebehind.. if u r using web form asp.net

TextBox NewTextBox = new TextBox();
            NewTextBox.ID = "TextBox" + i.ToString();
            //form1 is a form in my .aspx file with runat=server attribute
            form1.Controls.Add(NewTextBox);


form1 can be form id or div id or any parent container.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900