ASP.NET Code
  Home arrow ASP.NET Code arrow Page 2 - How to Use the ListBox Control in ASP.NET ...
Iron Speed
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Dedicated Servers 
Download TestComplete 
Windows Web Hosting
 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ASP.NET CODE

How to Use the ListBox Control in ASP.NET 2.0
By: Jayaram Krishnaswamy
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 57
    2007-02-27

    Table of Contents:
  • How to Use the ListBox Control in ASP.NET 2.0
  • Usage of the ListBox Control in web pages
  • ListBox Examples
  • Dynamic binding to data at run time
  • Databound ListBox Example
  • Steps in converting a Unbound ListBox to a Bound ListBox

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    Iron Speed
     
    ADVERTISEMENT

    Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!

    How to Use the ListBox Control in ASP.NET 2.0 - Usage of the ListBox Control in web pages
    (Page 2 of 6 )

    In an earlier article on VS2003 an example of binding a ListBox control using a DataReader was shown. ListBox can be used to display not only data from a backend database but also other kinds of lists. ListBox events can then be used for displaying list-related information. The following examples use either simple lists or data from a backend database. In the case of a backend database, however, any of the data source controls can be used. For the examples shown an AccessDataSource Control in the VS 2005 IDE is chosen.

    On Using the AccessDataSource Control

    The AccessDataSource control takes you the very center of RAD. Writing code is almost reduced to a single line. No more connection strings that tangle here, there and everywhere. Most of what you want to do can be done at design time. The IDE even gives you a query editor. An earlier article shows how you may use this data source control with a large number of screen shots. A few major screen shots are shown here.

    Step 1

    You must first add a source to the data connection, which will add the nwind.mdb file on your local drive as shown in the Server Explorer window. In this picture it is shown as being refreshed.


    Step 2

    Next you bring the connection to the App_Data folder of your website. When this is accomplished your website should appear as shown in the following picture.

    More ASP.NET Code Articles
    More By Jayaram Krishnaswamy


       · Declarative binding makes it very easy to work with databases even for those who are...
       · I am using the FormView control to create a form with a number of different type of...
       · Does the stored procedure work in the management studio correctly without...
     

    ASP.NET CODE ARTICLES

    - How to Use the ListBox Control in ASP.NET 2.0
    - How to Load XML Documents in ASP.NET 2.0
    - DataGrid Code
    - ASP.NET Guestbook
    - User Controls and Client Side Scripting
    - ASP.NET Programming with Microsoft's AS...
    - ASP.NET Basics (part 3): Hard Choices
    - ASP.NET Basics (part 2): Not My Type
    - ASP.NET Basics (part 1): Nothing But .Net
    - Directory Tree Browser
    - How to get the confirmation of Yes/No from a...
    - Complete example using custom errors and wri...
    - Paging Certain # records per page .NET style
    - General Methods of formatting and Subtractin...
    - .NET LinkButton web control

     
    Accelerating Trading Partner Performance
     
    Competing on Analytics
     
    Cost Effective Scaling with Virtualization and Coyote Point Systems
     
    Five Checkpoints to Implementing IP Telephony
     
    Hosted Email Security: Staying Ahead of New Threats
     




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway