Solved

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

Posted on 2011-03-14
3
612 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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

617 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