Hello, i am trying to insert items in a ListBox (using
VB) like this:
<script language="
VB" runat="server">
Sub Page_Load(src as Object, e as EventArgs)
MyListBox.Items.Add(new ListItem("Template1","template1"))
MyListBox.Items.Add(new ListItem("Template2","template2"))
MyListBox.Items.Add(new ListItem("Template3","template3"))
End Sub
</script>
And the ListBox:
<asp:listbox id="MyListBox" style="Z-INDEX: 115; LEFT: 664px;
POSITION: absolute; TOP: 224px"
runat="server" Height="168px" Width="160px">
</asp:listbox>
Well..
The problem is that it designs the ListBox, but it doesn't insert the items.
Any reason for that happen??
Am i doing something wrong?
Thanx a lot,
Nuno Oliveira.
PS:
I have allrady tryied to do it like this:
<script language="
VB" runat="server">
Sub Page_Load(src as Object, e as EventArgs)
Dim arrList as new ArrayList()
arrList.Add("Template 1")
arrList.Add("Template 2")
arrList.Add("Template 3")
MyListBox.DataSource = arrList
MyListBox.DataBind()
End Sub
</script>