Solved

ASP.NET - How do I reset a list box's data source to null?

Posted on 2011-03-14
3
610 Views
Last Modified: 2012-05-11
In the image below, the Reports list box is populated when the user selects a value in the Report Category DDL.  I'm working on the code under the Reset Button.  I want to Reset the list box data source to null.  (I want the Reset button to make list box to appear empty.)  How do I do this?
Reset-List-Box.png
0
Comment
Question by:jdana
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 39

Expert Comment

by:Pratima Pharande
ID: 35126839
add this code on reset

  ListBox1.DataSource = Nothing
        ListBox1.DataBind()
0
 

Accepted Solution

by:
royshantanu20001 earned 250 total points
ID: 35126904
Use This,



listBox1.Items.Clear();
0
 

Author Closing Comment

by:jdana
ID: 35126976
Thanks!
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question