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.

Sunday, August 24, 2014

Asp checkboxlist Example using C#

Asp checkboxlist Example using C#:

In this post we consider a example of checkboxlist by using C# code. In this tutorial we also consider Introduction of “ checkboxlist control example”. If you want to basic things about checkboxlist then visit this post.
We take many other Examples related to the checkboxlist that describe different-2 way and solutions related to the web development these are:

Now we take one more checkboxlist Example here :

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

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

<html xmlns="">
<head runat="server">
    <form id="form1" runat="server">
    <div align="center">
        Asp Example of checkboxlist:</h2>
        <asp:CheckBoxList ID="CheckBoxList1" runat="server" Height="177px"
            style="font-weight: 700; font-family: Arial, Helvetica, sans-serif; font-size: large">
        <asp:Label ID="Label1" runat="server" style="font-weight: 700; color: #FF0000"></asp:Label>
        <br />

        <asp:Button ID="Button1" runat="server" Text="check" onclick="Button1_Click"
            style="font-weight: 700" Width="93px" />
Asp checkboxlist Example using C#

 using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Asp_net_checkboxlist : System.Web.UI.Page
    protected void Page_Load(object sender, EventArgs e)


    protected void Btn1_Click(object sender, EventArgs e)
        foreach (ListItem li1 in CBL1.Items)
            if (li1.Selected == true)
                Lbl1.Text += li1.Text + "<br />";

Other Example:

No comments:

Post a Comment