Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default RE: listbox

    Could you provide some source code to give an example of your problem?

    Chris Moore [msft]
    Visual Studio Update
    --------------------
    >From: "jeff" <vader1000x@yahoo.com>
    >Subject: listbox
    >Date: Mon, 23 Jun 2003 15:10:19 -0400
    >Lines: 9
    >X-Priority: 3
    >X-MSMail-Priority: Normal
    >X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
    >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
    >Message-ID: <u3ZlbubODHA.3408@tk2msftngp13.phx.gbl>
    >Newsgroups: microsoft.public.dotnet.framework.aspnet
    >NNTP-Posting-Host: washdc3-ar4-4-35-058-209.washdc3.dsl-verizon.net
    4.35.58.209
    >Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftn gp13.phx.gbl
    >Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:154384
    >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    >
    >i have an unbound webforms listbox. when i add items and select something,
    >selecteditem, selectedvalue are nothing. selectedindex is -1. if i us the
    >exact same code with an unbound combobox, it returns a selected item.
    >
    >wassup wit dat? i'm using .net 1.1 w/vb.
    >
    >jeff
    >
    >
    >
    Chris Moore Guest

  2. Similar Questions and Discussions

    1. xml to combobox, combobox to listbox, listbox todetails
      i am going out of my mind looking for a tutorial i am able to use a xml document and the xml connector component to populate a pulldown menu, i...
    2. listbox to populate a listbox
      I am trying to use a listbox that I have setup using flash remoting call to a db. What I want to happen is when you click on a item in first the...
    3. click listbox and refresh another listbox
      Can someone guide me to a resource on building set of drill-down listboxes? Basically I want to have 4 listboxes. The first starts out with...
    4. Item label displays as "," when moving from listbox to listbox
      I have 2 listboxes: "lb_unselected" and "lb_selected". The first thing in the actions is loop through an array populating these two listboxes. ...
    5. now desparate! - 1st listbox contents disappears when 2nd listbox appears?
      On 23 Jun 2003 12:57:45 -0700, KathyBurke40@attbi.com (KathyB) wrote: Its been a while since you posted but I will answer anyway. The problem...
  3. #2

    Default Re: listbox

    i found the problem after a lot of digging. for whatever reason, i had to
    put my listbox.add("x") code inside of an if not ispostback.

    jeff

    "Chris Moore" <bork111@yahoo.com> wrote in message
    news:ns0VW5MPDHA.1640@cpmsftngxa06.phx.gbl...
    > Could you provide some source code to give an example of your problem?
    >
    > Chris Moore [msft]
    > Visual Studio Update
    > --------------------
    > >From: "jeff" <vader1000x@yahoo.com>
    > >Subject: listbox
    > >Date: Mon, 23 Jun 2003 15:10:19 -0400
    > >Lines: 9
    > >X-Priority: 3
    > >X-MSMail-Priority: Normal
    > >X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
    > >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
    > >Message-ID: <u3ZlbubODHA.3408@tk2msftngp13.phx.gbl>
    > >Newsgroups: microsoft.public.dotnet.framework.aspnet
    > >NNTP-Posting-Host: washdc3-ar4-4-35-058-209.washdc3.dsl-verizon.net
    > 4.35.58.209
    > >Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftn gp13.phx.gbl
    > >Xref: cpmsftngxa06.phx.gbl
    microsoft.public.dotnet.framework.aspnet:154384
    > >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    > >
    > >i have an unbound webforms listbox. when i add items and select
    something,
    > >selecteditem, selectedvalue are nothing. selectedindex is -1. if i us
    the
    > >exact same code with an unbound combobox, it returns a selected item.
    > >
    > >wassup wit dat? i'm using .net 1.1 w/vb.
    > >
    > >jeff
    > >
    > >
    > >
    >

    jeff Guest

  4. #3

    Default Re: ListBox

    I would recommend adding the items to the HttpContext. As you're using
    Server.Transfer, you should be able to grab them back out of it in the
    target page.

    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    [url]http://www.takempis.com[/url]
    Big things are made up of
    lots of little things.

    "Alberto" <aconti@stsci.edu> wrote in message
    news:633f92d6.0307140914.40fa0441@posting.google.c om...
    > Hi Keven,
    >
    >
    > doing this
    >
    > for (int i = 0; i < outputColumnsListBox.Items.Count; i++)
    > {outputColumnsListBox.Items[i].Selected = true;}
    >
    > will indeed set the items to "selected", however I still cannot pass
    > the selected items to a new asp.net page. Somehow the page does not
    > know that all items have been selected.
    >
    > Alberto
    >
    >
    > "Kevin Spencer" <kevinDIESPAMMERSDIE@takempis.com> wrote in message
    news:<O0zCwhZSDHA.2256@TK2MSFTNGP11.phx.gbl>...
    > > A Listbox can only have ONE SelectedIndex. It can have many options that
    are
    > > selected, though. Set the "selected" property of the list Items.
    > >
    > > --
    > > HTH,
    > >
    > > Kevin Spencer
    > > .Net Developer
    > > Microsoft MVP
    > > [url]http://www.takempis.com[/url]
    > > Big things are made up
    > > of lots of little things
    > >
    > > "Alberto" <aconti@stsci.edu> wrote in message
    > > news:633f92d6.0307131515.4dfe0a36@posting.google.c om...
    > > > Hi,
    > > >
    > > > I have an ASP.NET application with C# code behind that has a ListBox.
    > > > The user is allowed to decide the order and the number of items in the
    > > > list box. The items make up a list of output columns to be displayed
    > > > in a new page.
    > > > Once the user is satisfied, he/she will hit Submit and the values of
    > > > *ALL* listbox items remaining have to be passed to a new ASP.NET page.
    > > >
    > > > I need to be able to select ALL items in the Listbox BEFORE I issue a
    > > > Server.Tranfer(url) even if the user has selected one or two.
    > > > Unfortunately,
    > > > when I retreive the value of the listbox in the new page
    > > > (Request.Params["outputColumnsListBox"]) I only retreive what the user
    > > > selects on the page.
    > > > I tried something like this in the source page
    > > >
    > > > for (int i = 0; i < outputColumnsListBox.Items.Count; i++)
    > > > {outputColumnsListBox.SelectedIndex = i;}
    > > >
    > > > but it does not work. How do I select ALL items and pass them to a new
    > > > page?
    > > > Thanks!
    > > > Alberto

    Kevin Spencer Guest

  5. #4

    Default Re: ListBox

    You can save the selected items in a session variant in the source page,
    and retrieve them in the New page. Will this help on the problem?

    Luke

    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)

    Luke Zhang [MSFT] Guest

  6. #5

    Default Re: ListBox

    Hi Keven,

    I have read your suggestion, but I am not sure how to proceed.
    Doing this:

    outputColumnsListBox.Items[i].Selected = true;
    HttpContext.Current.Items.Add(outputColumnsListBox ,outputColumnsListBox.Items[i].Value);

    causes an error "Item has already been added" since
    outputColumnsListBox already exists... Do I have to add another
    object?
    If so, fine, but how do I then call it from the next page?
    Right now I use Request.Params["outputColumnsListBox"] which does
    return the selected fields, but only the selected ones.

    Ciao,
    Alberto


    "Kevin Spencer" <kevin@takempis.com> wrote in message news:<ugE6xmjSDHA.1252@TK2MSFTNGP10.phx.gbl>...
    > I would recommend adding the items to the HttpContext. As you're using
    > Server.Transfer, you should be able to grab them back out of it in the
    > target page.
    >
    > HTH,
    >
    > Kevin Spencer
    > Microsoft MVP
    > .Net Developer
    > [url]http://www.takempis.com[/url]
    > Big things are made up of
    > lots of little things.
    >
    > "Alberto" <aconti@stsci.edu> wrote in message
    > news:633f92d6.0307140914.40fa0441@posting.google.c om...
    > > Hi Keven,
    > >
    > >
    > > doing this
    > >
    > > for (int i = 0; i < outputColumnsListBox.Items.Count; i++)
    > > {outputColumnsListBox.Items[i].Selected = true;}
    > >
    > > will indeed set the items to "selected", however I still cannot pass
    > > the selected items to a new asp.net page. Somehow the page does not
    > > know that all items have been selected.
    > >
    > > Alberto
    > >
    > >
    > > "Kevin Spencer" <kevinDIESPAMMERSDIE@takempis.com> wrote in message
    > news:<O0zCwhZSDHA.2256@TK2MSFTNGP11.phx.gbl>...
    > > > A Listbox can only have ONE SelectedIndex. It can have many options that
    > are
    > > > selected, though. Set the "selected" property of the list Items.
    > > >
    > > > --
    > > > HTH,
    > > >
    > > > Kevin Spencer
    > > > .Net Developer
    > > > Microsoft MVP
    > > > [url]http://www.takempis.com[/url]
    > > > Big things are made up
    > > > of lots of little things
    > > >
    > > > "Alberto" <aconti@stsci.edu> wrote in message
    > > > news:633f92d6.0307131515.4dfe0a36@posting.google.c om...
    > > > > Hi,
    > > > >
    > > > > I have an ASP.NET application with C# code behind that has a ListBox.
    > > > > The user is allowed to decide the order and the number of items in the
    > > > > list box. The items make up a list of output columns to be displayed
    > > > > in a new page.
    > > > > Once the user is satisfied, he/she will hit Submit and the values of
    > > > > *ALL* listbox items remaining have to be passed to a new ASP.NET page.
    > > > >
    > > > > I need to be able to select ALL items in the Listbox BEFORE I issue a
    > > > > Server.Tranfer(url) even if the user has selected one or two.
    > > > > Unfortunately,
    > > > > when I retreive the value of the listbox in the new page
    > > > > (Request.Params["outputColumnsListBox"]) I only retreive what the user
    > > > > selects on the page.
    > > > > I tried something like this in the source page
    > > > >
    > > > > for (int i = 0; i < outputColumnsListBox.Items.Count; i++)
    > > > > {outputColumnsListBox.SelectedIndex = i;}
    > > > >
    > > > > but it does not work. How do I select ALL items and pass them to a new
    > > > > page?
    > > > > Thanks!
    > > > > Alberto
    Alberto Guest

  7. #6

    Default Re: ListBox

    Hi,

    I have solved the problem. I really did not want to save this list in
    a session variable, so I created a property of the source page that I
    can call from the destination page.

    Thanks for your help.
    Alberto

    [email]lukezhan@online.microsoft.com[/email] (Luke Zhang [MSFT]) wrote in message news:<0qho$YnSDHA.1928@cpmsftngxa06.phx.gbl>...
    > You can save the selected items in a session variant in the source page,
    > and retrieve them in the New page. Will this help on the problem?
    >
    > Luke
    >
    > (This posting is provided "AS IS", with no warranties, and confers no
    > rights.)
    Alberto Guest

  8. #7

    Default listbox

    Hi,

    I have many listbox and the items added come from a listbox1 to a listbox2 and ... in the last I need a action in each item to open (load) a movie.

    By clicking in the item it automaticly open the movie.

    How can we make this?

    Help me pls, Tk.


    moskito_pt webforumsuser@macromedia.com Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139