Working with ListBox

  • Thread starter Thread starter ?+?
  • Start date Start date
?

?+?

<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
 
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
 
Back
Top