I have a list box control which I am filling from the page’s code behind.
It works with values from 1 to 100, but what if the range I need gets really large? (For example, 1 to 200000000?)
Currently I am using this:
<asp:ListBox ID="ListBox1" runat="server" EnableTheming="True"
Height="20px" Width="54px">
</asp:ListBox>
And in my code behind:
for (int i = 0; i < 100; i++)
{
ListBox1.Items.Add(i.ToString());
}
What is the correct way to approach this problem?
You could use the NumericUpDown tool from the AJAX toolkit. It lets you enter numbers as well as scroll up and down, without having a varying scrollbar.