aspx Tutorial

.NET Articles,jQuery demo, asp.net with jQuery, online tutorial,Jquery, SilverLight, Javascript, asp.net,JSON, MVC,.NET Articles,demo, Web Services, .NET articles, Sharepoint 2010, visual studio 2010,Aamir Hasan,IT
Advertise Here

Advertize

wwwSW
Posted by Aamir Hasan   on Thursday, November 17, 2011 Total Views:  

This article demonstrates how to check/ uncheck all checkbox in asp.net repeater using jQuery. I have used CDN hosted jQuery 1.6.2 reference. You can download jQuery 1.6.2 from here.

 

Here is an example

<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">

    <title></title>

    <style>

        #table1

        {

            width: 500px;

            font-size: .80em;

            font-family: "Helvetica Neue" , Arial, Helvetica, Verdana, sans-serif;

            margin: 0px;

            padding: 0px;

            color: #666;

        }

 

        #table1 th

        {

 

            border-bottom: 1px solid #eee;

            border-top: 1px solid #eee;

            height: 29px;

            text-align: left;

            padding-left: 10px;

            background-color: #fafafa;

        }

 

        #table1 td

        {

            border-bottom: 1px solid #eee;

            padding-left: 10px;

        }

    </style>

 

    <script src="http://code.jquery.com/jquery-1.6.2.min.js" type="text/javascript"></script>

    <script type="text/javascript">

        $(document).ready(function () {

            $("#chkSelect").click(function () {

                var chkBox = $(this).is(":checked");

                $("#table1 input[type='checkbox']").attr("checked", chkBox);

            });

        });

    </script>

</head>

<body>

    <form id="form1" runat="server">

    <div>

     <p>

     <h1>   How to select unslect all checkboxes in asp.net repeater using jQuery.  </h1>

    </p>

         <asp:Repeater ID="Repeater1" runat="server">

             <HeaderTemplate>

                 <table id="table1">

                     <thead>

                         <tr>

                          <th>

                                 <input id="chkSelect" type="checkbox" />

                             </th>

                            <th>                              Title

                            </th>

                            <th>

                               Author

                            </th>

                             <th>

                                 Price

                             </th>

                         </tr>

                     </thead>

                     <tbody>

             </HeaderTemplate>

             <ItemTemplate>

                 <tr>

                   <td>

                        <input type="checkbox" />

                     </td>

                     <td>

                         <%# ((Book)Container.DataItem).Title %>

                     </td>

                     <td>

                         <%# ((Book)Container.DataItem).Author %>

                     </td>

                     <td>

                         <%# ((Book)Container.DataItem).Price %>

                     </td>

                 </tr>

             </ItemTemplate>

             <FooterTemplate>

                 </tbody>

                 <tfoot>

                     <tr>

                         <th colspan="3">

                             &nbsp

                         </th>

                         <th>

                             <div id="total">

                             </div>

                         </th>

                     </tr>

                 </tfoot>

                 </table>

             </FooterTemplate>

         </asp:Repeater>

     </div>

     </form>

 </body>

 </html>

 

Note: I have tested this example on IE, Firefox,iPad,Ipod,Opera,Safari and Chrome.

 

Output

Download

Repeater-jQuery-Checked-Unchecked.zip (1.87 kb)

See Live demo

Category:
Protected by Copyscape Online Plagiarism Tool

Comments (6) -

Web design sheffield
Web design sheffield United Kingdom
11/17/2011 6:35:37 PM #

Great post. I found what I was looking for. Do you mind if I post this on my website and give you credit? If not, it’s ok.

Moncler Jackets
Moncler Jackets People's Republic of China
12/4/2011 9:53:05 PM #

555yxj6
http://www.cheapmonclersjacketsales.com/

ugg bailey button triplet
ugg bailey button triplet People's Republic of China
12/4/2011 9:54:10 PM #

555yxj13
http://www.okuggbootsforcheap.com/

Cheap Timberland Boots
Cheap Timberland Boots United States
12/5/2011 2:08:57 AM #

555ce23
http://www.timberlandonlineboots.com/

moncler outlet
moncler outlet Philippines
12/12/2011 2:58:43 AM #

Carry on <a href="http://www.monclersoutlet2012.com"; rel="nofollow">moncler italia</a> with your fingertips, in fact, is the simple, practical style, is the most typical
<a href="http://www.monclersonlineoutlet.com"; rel="nofollow">moncler outlet</a> of style.
Thank you for sharing information about
<a href="http://www.vivierrogermilano.com"; rel="nofollow">roger vivier</a>, which I learned a lot, but also know a lot of knowledge about <a href="http://www.burberryoutletborsa.com"; rel="nofollow">burberry outlet</a>

men ugg boots
men ugg boots People's Republic of China
1/11/2012 8:13:35 PM #

ZY-This ugg boots works! Nowadays you will find more and more more approaches to pick from discount pandora rose ring onyx,they are a nice of footwear. http://www.winterboots-uk.biz  . ugg boots can be encountered in short and high styles. winter boots Ultimate Tall Braid and pandora jewellery can be encountered in colors from pink and crimson, pandora bracelet to tan and earth colour outlet while UGG Men Boots can be pandora rose ring in the bigger neutral colors. http://www.pandorajewellry.org/ .

discount burberry handbags
discount burberry handbags Poland
2/16/2012 3:36:47 PM #

A nice example is that dreaded polar ice cap, which some scientists say isn't starting to melt at all but instead will shortly begin to enlarge rapidly, giving birth to a new ice age that burberry belt wholesale will cover the entire United States..http://www.burberrysonlinestore.com/ LWZ

adidas f50
adidas f50 People's Republic of China
2/29/2012 3:06:59 PM #

I long to alleviate the evil, but I cannot, and I too suffer. cheap soccer shoes has been my life. I have found it worth living, and would gladly live it again if the chance were offered me. http://www.ussoccercleat.com/ CF

fafafa
fafafa Slovenia
4/23/2012 1:57:11 AM #

http://www.christianlouboutinukk.org   christian louboutin
http://www.tiffanyuks.org   tiffany uk
http://www.gucciukbeltuk.org   gucci belt
http://www.frsaclouisvuittonsac.com   louis vuitton sac
http://www.chanelukoutletuks.org   chanel outlet
http://www.burberryukoutletuk.org   burberry
http://www.poloralphlaurenuko.org   ralph lauren uk

feel
feel People's Republic of China
5/3/2012 12:28:20 AM #


Cheap NFL,NBA,MLB,NHL [url=http://www.annajerseys.com/]China Jerseys[/url],[url=http://www.annajerseys.com/]China Jerseys Paypal[/url] For Sale online.[url=www.annajerseys.com/...ke-nfl-jerseys-c-1_478.html]2012 Nike NFL Jerseys[/url],All Our Jerseys Are Sewn On and Directly From [url=www.annajerseys.com/...d-patriots-c-1_478_498.html]Nike New England Patriots Jerseys[/url] Factory2012 [url=www.annajerseys.com/.../...fl-jerseys-c-1_478.html]Nike NFL Jerseys China[/url] Wholesale,Wholesale [url=www.annajerseys.com/...falo-bills-c-1_478_482.html]Nike Buffalo Bills Jerseys[/url] From,The high quality Nike NFL Jerseys are  [url=www.annajerseys.com/...oston-bruins-c-124_133.html]Boston Bruins Jerseys[/url] great gifts [url=www.annajerseys.com/...o-blackhawks-c-124_137.html]Chicago Blackhawks Jerseys China[/url] for Arizona Cardinals  [url=www.annajerseys.com/...e-seahawks-c-1_478_507.html]Nike Seattle Seahawks Jerseys[/url].Welcome to our [url=http://www.annajerseys.com/]http://www.annajerseys.com/[/url] to pick [url=www.annajerseys.com/...hia-eagles-c-1_478_503.html]Nike Philadelphia Eagles Jerseys[/url] the hotest [url=www.annajerseys.com/.../...fl-jerseys-c-1_478.html]2012 New NFL Jerseys[/url].
[/pre]

  Best Converse Online Store From UK,Sale 2011 Newest [url=www.sale-converse.com/...rse-flag-shoes-c-130.html]Converse Flag Shoes[/url],Black Converse,[url=www.sale-converse.com/...ewest-converse-c-135.html]Converse 2012[/url],[url=http://www.sale-converse.com/]Cheap Converse[/url] Navy Converse And So on [url=www.sale-converse.com/...-hitop-uk-flag-p-899.html]Converse 2011 All Star Shoes Hi-top UK Flag[/url],[url=http://www.sale-converse.com/]Converse UK[/url],[url=www.sale-converse.com/...rica-flag-red-p-1037.html]Converse 2011 All Star Shoes Hi-top America Flag Red[/url]Free Shipping
[/pre]

We are professional jerseys manufacturer from china,wholesal sports [url=http://www.anna-jersey.com/nfl-jerseys-c-773.html]NFL jerseys China[/url],[url=http://www.anna-jersey.com/nhl-jerseys-c-882.html]NHL Jerseys China[/url],[url=http://www.anna-jersey.com/nba-jerseys-c-821.html]NBA Jerseys China[/url],[url=http://www.anna-jersey.com/mlb-jerseys-c-694.html]MLB Jerseys China[/url],[url=http://www.anna-jersey.com/]China Jerseys[/url],  [url=www.anna-jersey.com/...nike-nfl-jerseys-c-943.html]2012 Nike NFL Jerseys[/url],[url=www.anna-jersey.com/...chicago-cubs-c-694_702.html]Chicago Cubs Jerseys China[/url], Free Shipping
[/pre]
[pre]
,[url=http://www.china4jersey.com/nhl-jerseys-c-512.html]NHL Jerseys China[/url] Paypal,[url=http://www.china4jersey.com/]China Jerseys Paypal[/url] factory,Sewn On Jerseys,Accept Paypal,Free Shipping,[url=www.china4jersey.com/nike-nfl-2012-c-638.html]Nike NFL Jerseys Paypal[/url]   ,Nike Jerseys,[url=www.china4jersey.com/nike-nfl-2012-c-638.html]NFL Jerseys 2012[/url],[url=www.china4jersey.com/nike-nfl-2012-c-638.html]Nike Jerseys China[/url],[url=www.china4jersey.com/nike-nfl-2012-c-638.html]Wholesale Nike Jerseys China[/url][url=http://www.nikenflchina.com/]Nike NFL Jerseys[/url],[url=http://www.nikenflchina.com/]New NFL Jerseys 2012[/url],[url=http://www.nikenflchina.com/]Nike NFL Jerseys China[/url],[url=www.nikenflchina.com/...nike-nfl-jerseys-c-73.html]2012 Nike NFL Jerseys[/url],[url=www.china4jersey.com/...ton-red-sox-c-398_401.html]Boston Red Sox[/url]Professional Online Wholesale Shop From China,We are Chinese Jerseys Manufactruer,Wholesale All Team Of Nike NFL Jerseys,2012 New NFL Jeresys,NFL Jerseys China,Nike Jerseys China,New NFL Jerseys,All Jerseys are embroidered on,Free Shipping To World Wide
[/pre]

Professional Converse Online Store From UK,[url=http://www.converse2you.com/]Converse UK[/url] Shop,Sale 2012 Newest Converse All Stars,Converse Flag Shoes,[url=http://www.converse2you.com/]Cheap Converse[/url],[url=http://www.converse2you.com/]Converse Sale[/url],[url=www.converse2you.com/index.php]Converse Flag Shoes[/url] ,[url=www.converse2you.com/index.php]New Converse 2012[/url] Free Shipping To World Wide.
[/pre]

Add comment

  Country flag

biuquote
  • Comment
  • Preview
Loading

Advertizement 1
Advertizement 2
Advertizement 3
Advertizement 4
Advertizement 5