Here's one way you can do it with DataBinding. The aspx page:
Code:
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="DynoDropDown.aspx.vb" Inherits="localhost.DynoDropDown"%>
<html>
<body>
<form runat="server">
<asp:DropDownList ID="myDropDown" Runat="server"/>
</form>
</body>
</html>
and the code behind:
VB Code:
Imports System
Imports System.Collections
Public Class DynoDropDown : Inherits System.Web.UI.Page
Protected myDropDown As DropDownList
Protected Overrides Sub OnInit(ByVal e As EventArgs)
Dim list As New ArrayList(10)
For i As Int32 = 1 To 10
list.Add("info" + i.ToString())
Next
Session.Item("MyArrayList") = list
myDropDown.DataSource = CType(Session.Item("MyArrayList"), ArrayList)
myDropDown.DataBind()
End Sub
End Class