473,385 Members | 1,830 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Unable to remove items from an asp.net listbox

I populate a listbox with the following code when my form loads:

lstBox.Items.Add("value");

Once the page loads, I give the user the ability to remove items from the
list box by selecting an item and executing the following code from a button
click event:

lstBoxs.Items.Remove(lstBox.SelectedItem);

This works as expected for items added to the box by the end user after the
page loads, but fails to work with items added when the page loads. Anyone
know what gives, or a workaround?
Jul 27 '05 #1
0 1345

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Supra | last post by:
in vb6 listbox1.remove item 5 how will i do in vb.net? regards
4
by: Bilo | last post by:
I dont know what i am doing false. the code : private void button2_Click(object sender, System.EventArgs e) { foreach (string filename in listBox1.SelectedItems)...
4
by: mostafa atalla | last post by:
How can I remove some selected items from the listBox in the run time ??
1
by: Dan Bass | last post by:
I'm looking to develop a listbox with in-place editing where as each item is selected, it grows to fit in all the text boxes. When the item is deselected, it shrinks back to its original size. The...
4
by: Ron | last post by:
I've got a listbox that holds a list of groups. Users can select a group, hit the remove button and the group should be removed from the listbox. The only problem is that no matter which group you...
2
by: Rene | last post by:
Hi all i need some help. i try to send mail with the following code. Private Sub LinkButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LinkButton1.Click Dim...
3
by: Bill Nguyen | last post by:
I use the following example (from another post) and it seemed to work fine. However, when I add the syntax to remove the selected item from the senderbox, I got error....
0
by: Shawn K | last post by:
I populate a listbox with the following code when my form loads: lstBox.Items.Add("value"); Once the page loads, I give the user the ability to remove items from the list box by selecting an...
1
by: divya | last post by:
Hello, I used the below code to move selected items between two listboxes Left and Right:- <%@ Page Language="C#" AutoEventWireup="true" CodeFile="TestPopup.aspx.cs" Inherits="TestPopup" %> ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.