Depends. Do you want to do this client side or server side? Is there a button involved or is this some sort of AJAX that is fired off when the Textbox value changes?
Since you posted in the ASP.NET forum I will assume you want to do this server side so some code like the following would work:
csharp Code:
for(int i =
0; i < Convert.
ToInt32(textBox1.
Text); i++
){ ListItem item =
new ListItem
("someText",
"someValue");
DropDownList1.
Items.
Add(item
);
}
Obviously there is no error checking in this code to check to make sure that a whole number was passed in and not, say, a string but you should get the idea.
hth.
-Doug
__________________
===============================================
Doug Parsons
Wrox online library:
Wrox Books 24 x 7
Did someone here help you? Click

on their post!
"Easy is the path to wisdom for those not blinded by themselves."
===============================================