Sorry if this is a dumb question ... I'm just trying to learn the best way to do it. Basically I want to have a dropdown list with values blank and then 0 - 100.
Whats is the best way to do this without manually entering each one. I imagine it is through some form of a list bound to the dropdown.
Thankyou in advance for the help.
Here is one way of doing it:
ddl.Items.AddRange(Enumerable.Range(0, 100).Select (e => new ListItem(e.ToString())).ToArray());
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With