hi
i want to generate text boxes dynamically .
when i run the program i will get input in integer in a text box with that input (ex input=5) then 5 text box should be generated in my page how to do it .

So, I assume that you'll have some type of button or other element that you will click. There needs to be an event handler to allow you to execute some code.

in this block of code, you read the value from your text box and then parse the data to make sure its an integer in your acceptable range of values.

Then setup a loop that will iterate up to the number of times of your input. Then just create the textboxes and add them to your placeholder element.

Something like this...its not tested, just to give you something to start with.

//this conceptual/pseudo code within your loop

TextBox txtBox = new TextBox();
txtBox.ID = "txtBox" + num;  //num could be the current iteration from the loop
placeholderElement.Controls.Add(txtBox);

Go back, do some reading, try some code and come back here with some example code of your own with additional questions.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.