ASP.net drop down list population

How can I populate a set number of text boxes when a user clicks on a number from a drop down listbox? I.e. The user clicks on the number 8, so then 8 textboxes show up. I know I can do it with a for next (do until) loop, but I’m unsure of the syntax, where I would put it on the page (would it be an on submit command, where it runs the function on submit?), if it would populate the text boxes on a new page or the same one, and how can I count how many of them there are so the asp knows how many boxes there are? I also need each box to have it’s own unique id so that the asp can differentiate between them all.

I’m not sure if it would be easier to do this in javascript, but either way I am unsure of the syntax. Thanks for any help in advance.