value of multi select listbox

Hey Guys,

I have 2 listboxes on a page used for adding and removing from an available list to a selected list. I have the value property of my available list set to id's from a database. When i select multiple items at the same time from listbox 1 and move them to listbox 2, i am always getting the same value for all of the items in listbox 2. Whats worse is that instead of getting the datavaluefield, i get the index of listbox 1 as the value field.
For example:
I choose items 2,3,5 from listbox 1 and when they are moved to listbox 2, my item.value is always 2 instead of having seperate values for each of the three items(It shouldnt even be 2, it should be the id from the database, but that is a side issue).
If anyone knows how to solve this issue, I would really appreciate it.
8/25/2003 2:26:55 PM 93655 articles. 6 followers. Follow

3 Replies

Similar Articles

[PageSpeed] 18

Are you using the ListItem.Value property or something else to determine the value of your items? Can you post some code?
8/25/2003 3:03:34 PM
Nevermind, i figured out a workaround.

Since i was still getting the correct text values, I just sent them to my stored procedure, wrote a mini select statement that would grab the corresponding values and then insert that where i needed it.
Thanks anyway
8/25/2003 3:14:33 PM
You may want to look at my free DualList control.
8/25/2003 8:37:34 PM

Similar Artilces:

Using selected values from a Multi Select Listbox in a SQL query
I have seen a few post concerning this but don't really understand fully as I am new to this.  I would appreciate any help 1) First I loop through the Listbox control and get the selected values: Dim li As ListItemFor Each li In lbPClass.Items If li.Selected = True Then strPC += li.Value & ", " End If Next Label5.Text = strPC The resulting string looks something like: 101, 102, 100 ,    I get rid of the last space and "," with the following statement Label6.Text = Left(Label5.Text, Trim(Len(Label5.Text) - 2)) 2) I would then like to ...

Listbox Multi Selected Value
I am trying to get the values selected in a list box on my web form; and use these value in an sql statement. I have done this within a windows form but i am struggling to work out how to achieve this in a web form; the windows form commands are not liked in the asp!!!  Any help or advice would be appreciated. here is a small example function  protected void Button1_Click(object sender, EventArgs e) { int count = ListBox1.Items.Count; for (int i = 0; i < count; i++) { if (ListBox1.Items[i].Selected == true) { ...

Passing Values from a Web Form to Another Web Form
Hello All! I am trying to pass values from one web form to another web form. I know that there are 3 ways of doing this: queryString, Server.Transfer and Session. I am using the Server.Transfer method. But I am not able to create, in my 2nd web form, an instance of my 1st web form. My 1st Web form is named CallTrack.aspx and my 2nd is named Export.aspx. What I mean is something like this: Public value as CallTrack. I can't create it in my 2nd web form because when the intellisense is displayed, there's no CallTrack in the options. Thanks!   How about using cross-...

Get listbox value from the other web form
 Dear all, I want to get the lisbox selecteditem value to a textbox in one web form from the other web page. Should I use session to get this value?Can any one help in this regard? Thanks a lot in advance.  People Develop People Yes you can use Session to get the informations between cross pages.. see below for your referenceTO STORE THE INFO in Session Session["key"] = ListBox1.SelectedItem.Value; Response.Redirect("Page2.aspx");TO GET THE VALUES FROM Sessionprotected void Page_Load(object sender, EventArgs e){    if (Sessio...

listbox selected value in
hi All, i had two listbox's side by side, i am loading items into listbox1 when the page is loaded, i am moving a item from listbox1 to listbox2 by using javascript. i want to populate listbox3 based on the listbox2 item, with out submiting the form, how can i get the listbox2 item in code behind file. can any one help me. thanks,        are you saying you want the selected item in listbox2 copied to listbox3 without a postback? If this is the case you could use javascript and the DOM to achieve this. Please Remember to click "Mark as Answer" o...

On selecting value in second listbox. selected value in first textbox is lost
     Hello all, In a webapplication , I have to store the selected values in hidden fields with following code  <INPUT type="hidden" name="hidPatient" value=""> <INPUT type="hidden" name="hidPatientStatus" value="">  when i select the value in any list box following javascript function is called with this code   Response.Write "<SELECT id=" & strSelName & " name=" & strSelName & " validation=" & strValidation & " ...

Implementing .Net Form into an web form, can this be done
I am new here, but have been searching for a while, and may not have the correct lingo to find what I am looking for.  I am tasked with implementing a .exe application that was writen vb6 then converted to .net into a new website my team is developing. The idea is to put each of the 3 different forms in this .exe application of 3 different .aspx pages. I have attempted multiple things to get this into the page and even started to just rewrite it as an web form, but even then I can't reuse any of the code since the System.Web.UI.Page doesn't inherit the sa...

Multi-select ListBox and Select All
Hi,I'm having an issue with some JS code for IE6 (no need for x-browser) and multi-select listbox.I'm trying to implement a Select All button.Current code is : function SelectAll(obj){ for (var i = 0; i < obj.options.length; i++) { obj.options[i].selected = true; } } which logically seems to work.  The problem I have is that this does not seem to work until I click the multi-select again.  It seems that although the options are marked as selected, the screen does not update to reflect this until something triggers it (in this case trying to click in ...

passing values to .net web form application
Hi Can any explain me abt how to pass values to my .NET web form application (designed using PB 11.1) from other web application? My intension is to redirect from a web application (ASP.NET to .net web form application) to my web application with user information. Thanks & Regards, Anbazhagan From the "Deploying Applications and Components to .NET" manual: >>> Starting an application with command line parameters If your application requires command line parameters, you can assign values to the PBCommandParm global property before you deploy the...

Return ListBox (Multiple) values from pop up child (javascript:ShowWindow) form listbox to parent form
Please advice me, how to get selected (multiple) values from a child pop up form constists of list box of available options back to parent window list box. I am not very familiar with this concept, please help me. If you have any URL or code samples send it to me. Thanks for your help. you would need to use javascript and send it by query string. I don't have the syntax right now as I am working on a similar problem myself. If I get it going soon I will post it....

Selecting multiple value from Listbox control in web page
I have a search web page which has one textbox, listitem, search button and datagrid.1) How can i select multiple value in the listbox control. (Either by using Ctrl or shift key)2) After selecting multiple value from the listbox, how can i use those selected value to find the results in search query.Ex. My query is: select * from table where name = @Name@Name = All selected value from listbox control.Thanks Dim iCnt as Integer = myListBox.Items.Count For i = 0 To iCnt - 1 If myListBox.Items(i).Selected Then'Do something here End If NextHope it helpsZath Set the SelectionMode ...

Getting a listbox to show the value selected from a posted form
I have a form with a Listbox on it. How do I get the form returned from the post action with the selected data in the listbox. Also what is the difference between a listbox and a dropdownlistbox ? A Listbox shows more than one item, visibly, at a time - - - A DropDownList shows only one item - - you must click on it, so it will 'Drop Down' and show you other items in the list. Check out: David WierMCP/ - where to look first!Please Vote for ASPNet101 - 'Best Community Resource...

Update selected RadioButtonList value to a label in a web form
 I have a web form and when you click a button, a ModalPopUp-control opens. It contains a RadioButtonList. All I want is that when user selects one of the RadioButtons in ModalPopup, it's value is updated back to a web form (label-control) using codebehind.  When I click the Update-button on the ModalPopup, the correct value (RadioButtonList's SelectedItem.Text) is passed and set to label's text-property, but label remains empty on the web form so it won't update.  Anyone, please? Hi k000der, From your description, I understand that you use the ModalPopupE...

Send e-mail with web form values (
I'm sure this is very simple but;I have a form with numerous (<50) textbox controls and related Label controls; ie: <asp:Label ID="Label1" runat="server" Text="Last Name: "></asp:Label> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>When the form is submitted I want to loop through each label control and textbox control and get their Text values for the e-mail without specifying each control. Anyone have suggestions on the best way to do this?Any assistance appreciated greatly!   Here is a solution for you in

Web resources about - value of multi select listbox -

Listbox • Email Marketing
... marketing services, where you can create your campaign in our online composer or from your own email program like Outlook or Mac Mail. Listbox ...

ListBox - To-Do + Birthdays on the App Store on iTunes
Get ListBox - To-Do + Birthdays on the App Store. See screenshots and ratings, and read customer reviews.

Windows Phone Mango change, Listbox: How to detect compression(end of scroll) states ?
... applications performance on mobile. [ Update : This is available after Beta2(Trial) build. Wait for RC/RTM builds] If you’ve ever used a ListBox ...

Listbox, Why Art Thou Blanking?
One of the biggest performance changes for developers using Silverlight in Mango (WP 7.5) is off-thread input for ListBox. In a nutshell this ...

Styling and DataBinding Silverlight 4.0 ListBox
In the latest version of my Podcast Aggregator application I’ve spent lots of time playing around with styling the standard Silverlight ListBox. ...

Stack Overflow
Q&A for professional and enthusiast programmers

bada - Wikipedia, the free encyclopedia
2.0.5 SDK / March 15, 2012 ; 2 months ago ( 2012-03-15 ) Bada (stylized as bada ; Korean : 바다 ) is an operating system for mobile devices such ...

Ballard Tote Bags - Ballard Designs
{"bundleMinimumPrice":20.0,"bundleMaximumPrice":25.0,"bundleMinimumListPrice":0.0,"bundleMaximumListPrice":0.0,"xPriceLabel":null,"currencyC ...

How suitable is Windows 8 Metro for business developers?
... sometimes conflict with each other. One thing I really don't like in Windows 8 when running desktop apps is how when you scroll in a listbox ...

CodeGuru - Microsoft developers related ideas, articles, tips, tricks, comments, downloads, and so much ...
CodeGuru is where developers can come to share ideas, articles, questions, answers, tips, tricks, comments, downloads, and so much more related ...

Resources last updated: 12/3/2015 4:35:18 PM