Working with ListBox

Discussion in 'ASP .Net' started by ?+?, May 24, 2004.

  1. ?+?

    ?+? Guest

    <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
    ?+?, May 24, 2004
    #1
    1. Advertising

  2. 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


    > <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.
    Calvin Luttrell/ProjectThunder.com, May 24, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. blenderdude
    Replies:
    0
    Views:
    801
    blenderdude
    Aug 3, 2003
  2. DC Gringo
    Replies:
    0
    Views:
    393
    DC Gringo
    Apr 6, 2004
  3. kent
    Replies:
    1
    Views:
    866
    Andrew de la Harpe
    May 3, 2004
  4. Simon Prince
    Replies:
    2
    Views:
    3,313
    =?Utf-8?B?TWljaGFlbCBUYXlsb3I=?=
    Oct 19, 2004
  5. Chris Kettenbach

    Listbox selection to populate another listbox?

    Chris Kettenbach, Jun 15, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    1,635
    Chris Kettenbach
    Jun 16, 2005
Loading...

Share This Page