Link to home
Start Free TrialLog in
Avatar of Rouchie
RouchieFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Quick way of displaying A-Z options in a DropDownList?

Currently I have a DropDownList that displays the options A-Z as follows;

<asp:DropDownList runat="server" id="letterList" >
    <asp:ListItem value="a">A</asp:ListItem>
    <asp:ListItem value="b">B</asp:ListItem>
    ...etc
    <asp:ListItem value="z">Z</asp:ListItem>
</asp:DropDownList>

Is there any way to achieve this quickly using some sort of looping functionality etc??
SOLUTION
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Rouchie

ASKER

The main reason I asked was so that I didn't have to write out all the letters of the alphabet.  Both examples unfortuntely employ that method.  Is there no functionality in .NET to loop through letters like there are numbers??
Avatar of mantarae
mantarae

Nope, there isn't an automatic way to get a-z.