Trying to clarify your question:
1. You have a text box that will accept only the letters A through Z (not impossible, requires client-side or server-side validation to filter out unwanted characters]. Once the letters are entered, they are used to populate a drop-down list [easy, either through a client side script or a post to the server and return of the populated drop down list]
-or-
2. You want a text box to contain "ABCDEFGHIJKLMNOPQRSTUVWXYZ" and a dropdown list with 26 options of "A" through "Z". [much easier]
1. For a user-populated drop down following input from the user to the server:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="textlist.aspx.vb" Inherits="textlist" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<input type="text" name="letters" id="letters" runat="server" /> <select name="myselect" id="myselect" runat="server"></select><br />
<input type="submit" value="GO" />
</div>
</form>
</body>
</html>
Imports System.Text.RegularExpressions
Partial Class textlist
Inherits System.Web.UI.Page
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
Dim letters As String = Page.Request.Params("letters")
myselect.Items.Clear()
If Not letters Is Nothing Then
Dim upper As New RegularExpressions.Regex("^([A-Z]{1,})$")
If Not upper.Match(letters).Length = 0 Then
Dim chars As Char() = letters.ToCharArray
For Each a As String In chars
myselect.Items.Add(a)
Next
End If
End If
End Sub
End Class
...
for client-side population of the drop-down before sending to the server, you can use JavaScript to parse the text box value and populate the select options.
2. For a pre-defined drop down:
- eliminate the parameter check (runs even without user input)
- assign the chars variable the desired values:
- assign the value of the text box the desired string.
chars="ABCDEFGHIJKLMNOPQRSTUVWXYZ".ToCharArray
...
<input type="text" name="letters" id="letters" value="ABCDEFGHIJKLMNOPQRSTUVWXYZ" />