I'm sorry but I don't understand your problem.
Lets assume you have the below stated example, it adds a few items to the listbox and after a selection is done, it responds the selected value to the page.....
Is thát what you achieved?
Partial Class _Default
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
For iCnt As Integer = 1 To 5
Dim lItem As New ListItem
lItem.Text = String.Format("New Item {0}", iCnt.ToString)
lItem.Value = iCnt
Me.ListBox1.Items.Add(lItem)
lItem = Nothing
Next iCnt
End If
End Sub
Protected Sub ListBox1_SelectedIndexChanged( _
ByVal sender As Object, _
ByVal e As System.EventArgs) _
Handles ListBox1.SelectedIndexChanged
HttpContext.Current.Response.Write( _
String.Format("Selected Value = {0}", _
CType(sender, ListBox).SelectedValue.ToString))
End Sub
End Class
pagecode;
<%@ Page
Language="VB"
AutoEventWireup="false"
CodeFile="Default.aspx.vb"
Inherits="_Default" %>
<!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>
<asp:ListBox
ID="ListBox1"
runat="server"
AutoPostBack="True" />
</div>
</form>
</body>
</html>
Last edited by 4advanced; Dec 1st, 2008 at 7:48 am.