asp.net.ph

CheckBoxList Constructor

System.Web.UI.WebControls Namespace   CheckBoxList Class


Initializes a new instance of the CheckBoxList class.

[ VB ]
Public Sub New ( )

[ C# ]
public CheckBoxList ( );

[ C++ ]
public: CheckBoxList ( );

[ JScript ]
public function CheckBoxList ( );

Remarks

Use this constructor to initialize a new instance of the CheckBoxList control.

Example


Example

The following example demonstrates how to initialize a new instance of the CheckBoxList class at run time.

void Page_Load ( Object src, EventArgs e ) {
   if ( !IsPostBack ) {
      ArrayList myListItems = new ArrayList ( );
      myListItems.Add ( "Item 1" );
      myListItems.Add ( "Item 2" );
      myListItems.Add ( "Item 3" );
      myListItems.Add ( "Item 4" );
      myListItems.Add ( "Item 5" );

      CheckBoxList myList = new CheckBoxList ( );
      Page.Controls.Add ( myList )
      myList.DataSource = myListItems;
      myList.DataBind ( );
   }
}
  C# VB

See Also

CheckBoxList Members Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph