programming we consider all important topic for knowledge about controls,web Services, JSON, Ajax, database, and interview related Question. In this and sql server tutorial blog we give many examples of jquery as like How Play YouTube Video in Your Website by URL, How to Play YouTube Videos in by using Jquery , Jquery Change div background on mouseover in , JQuery UI Datepicker (Calendar) etc.

Thursday, July 31, 2014

Checkbox list Example using javascript

CheckBoxList control example:

CheckBoxList is a Standard Server control of In this post we consider a simple example of CheckBoxList control.  in this tutorial we also consider Example of  Check Uncheck all html CheckBox controls using jQuery:

As we know that this control gives to permission to use to select more than one option at some time.

Code on aspx page

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="checkboxlist.aspx.cs" Inherits="checkboxlist" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">

<html xmlns="">
<head runat="server">
    <script runat="server"> 
    protected void Button1_Click(object sender, System.EventArgs e) { 
        Label1.Text = "You are selected :<br />"
        foreach(ListItem li1 in CheckBoxList1.Items){ 
            if (li1.Selected == true) { 
                Label1.Text += li1.Text + "<br />"
    <form id="form1" runat="server"> 
        <asp:Label ID="Label1" runat="server"></asp:Label> 
        <br /> 
        <asp:Label ID="Label2" runat="server" Text="Select  favorites" AssociatedControlID="CheckBoxList1"></asp:Label> 
        <asp:CheckBoxList ID="CheckBoxList1" runat="server"> 
        <br /> 
        <asp:Button ID="Button1" runat="server" Text="Show Result" OnClick="Button1_Click" /> 

How to use CheckBox control in with JavaScript:

In this checklist Example take one check list with id “CheckBoxList1” and consider five items. And on javascript function for display how many and whose are selected in particular list. programming
Check List

Other Post: