Working with ListBox

?

?+?

<form name="form1" id="form1" runat="server">
<asp:ListBox ID="ListBox1" DataSource="<%# SelIndex.DefaultView %>"
DataTextField="tblIndexDesc" DataValueField="tblIndexCode"
runat="server" SelectionMode="multiple"></asp:ListBox>
<asp:Button ID="Button1" Text="Submit" runat="server"
onClick="Submit"/>
</form>

First of all I'm still new in .NET.
I have a page call webform1.aspx. Part of the code as above. When I
click submit button I use server.transfer to transfer the form to
webform1.aspx. In ListBox1 when I do a couple of selection and submit
the form, I can retrived it in webform1.aspx. If I didn't select any
record and submit the form, I want all the ListBox1 value to be
transfered to webform1.aspx. How to do this without do any selection.
Next what I'm thinking is use an array to store ListBox1 value but I
don't know how to work with an array. Can anybody guide me on this
with the code and explaination.

Thank
 
C

Calvin Luttrell/ProjectThunder.com

You are using Server.Transfer to transfer a page to itself?

Dim astr() As String = {"NO", "WAY", "JOSE", ".COM"}
Me.ListBox1.Items.AddRange(astr)

-Calvin Luttrell
ProjectThunder.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top