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

Get CheckBoxList control values using Jquery:

Getting CheckBoxList values using jquery: 

CheckBoxList is a Standard ToolBox control. Here we take a simple example of CheckBoxList control in web page using jquery. As we know that the jquery is more advance of ajax and javaScript. In present time in web development either on or any other platform the jqury play the important roll. Many times we have a Question that is How to get values of selected items in CheckBoxList   using JQuery. Today we take a example code here.

Eventes of checkboxlist:

CallingDataMethods, CreatingModelDataSource, DataBinding, DataBound, Disposed, Init, Load, PreRender, SelectedIndexChanged, TextChanged,Unload.

Checkboxlist related other post on tutorial.

Checkboxlist Methods:

AddAttributesToRender, AddedControl, AddParsedSubObject, ApplyStyle, ApplyStyleSheetSkin, BeginRenderTracing, BuildProfileTree, ClearCachedClientID, ClearChildControlState, ClearChildState, ClearChildViewState, ClearEffectiveClientIDMode, ClearSelection, ConfirmInitState, CopyBaseAttributes,CreateChildControls, CreateControlCollection, CreateControlStyle, CreateDataSourceSelectArguments,
DataBind(), DataBind(Boolean), DataBindChildren, Dispose, EndRenderTracing, EnsureChildControls,EnsureDataBound, EnsureID, Equals(Object), Finalize, FindControl(String), FindControl(String, Int32),Focus, GetData, GetDataSource, GetDesignModeState, GetHashCode, GetItemStyle,GetRouteUrl(Object), GetRouteUrl(RouteValueDictionary), GetRouteUrl(String, Object),GetRouteUrl(String, RouteValueDictionary), GetType, GetUniqueIDRelativeToHasControls, HasEvents, IsLiteralContent, LoadControlState, LoadPostData, LoadViewState, MapPathSecure, MarkAsDataBound, MemberwiseClone, MergeStyle, OnBubbleEvent, OnCreatingModelDataSource, OnDataBinding, OnDataBound, OnDataPropertyChanged, OnDataSourceViewChanged, OnInit, OnLoad, OnPagePreLoad, OnPreRender, OnSelectedIndexChanged, OnTextChanged, OnUnload, OpenFile, PerformDataBinding, PerformSelect, RaiseBubbleEvent, RaisePostDataChangedEvent, RemovedControl, Render
RenderBeginTag, RenderChildren, RenderContents, RenderControl(HtmlTextWriter),
RenderControl(HtmlTextWriter, ControlAdapter), RenderEndTag,RenderItem, ResolveAdapter, ResolveClientUrl, ResolveUrl, SaveControlState, SaveViewState, SetDesignModeState, SetPostDataSelection, SetRenderMethodDelegate, SetTraceData(Object, Object), SetTraceData(Object, Object, Object), ToString, TrackViewState, ValidateDataSource, VerifyMultiSelect. Checkboxlist selected items in jquery:

<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeFile="Default.aspx.cs" Inherits="_Default" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $('#<%=cmdGet.ClientID %>').click(function () {
                var values = '';
                $('#<%=CheckBoxList1.ClientID %> input[type=checkbox]:checked').each(function () {
                    if (values.length == 0) {
                        values = $('label[for=' + + ']').html();
                    else {
                        values += "," + $('label[for=' + + ']').html();
                return false;
            <strong>Getting values of selected items in CheckBoxList</strong></h1>
        <br />
        <hr />
        <asp:CheckBoxList ID="CheckBoxList1" runat="server" RepeatDirection="Horizontal">

            <asp:ListItem Text="One" Value="1"></asp:ListItem>
            <asp:ListItem Text="Two" Value="2"></asp:ListItem>
            <asp:ListItem Text="Three" Value="3"></asp:ListItem>
            <asp:ListItem Text="Four" Value="4"></asp:ListItem>
            <asp:ListItem Text="Five" Value="5"></asp:ListItem>
        <hr />
        <br />
        <asp:Button runat="server" ID="cmdGet" Text="Get Selected Values" />
Get CheckBoxList control values using Jqury:
Get CheckBoxList control values using Jqury

For use of this code you need a file of jquey. So if you want then download it for here.

Other Related Posts:

No comments:

Post a Comment