Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7916173
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T14:42:38+00:00 2026-06-03T14:42:38+00:00

updated: <%@ Page Language=C# AutoEventWireup=true CodeBehind=chkbox_checked_uncheked.aspx.cs Inherits=Ediable_Repeater.chkbox_checked_uncheked %> <!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0

  • 0

updated:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="chkbox_checked_uncheked.aspx.cs"
    Inherits="Ediable_Repeater.chkbox_checked_uncheked" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script src="Scripts/jquery-1.6.2.min.js" type="text/javascript"></script>

    <script type="text/javascript">

        $(document).ready(function () {
            $('#C1All').click(function () {
                debugger
                $('.col1').attr("checked", $('#C1All').attr("checked"));
                $('.col2').removeAttr("checked");
                $('#C2All').removeAttr("checked");
            });

            $('#C2All').click(function () {
                debugger
                $('.col2').attr("checked", $('#C2All').attr("checked"));
                $('.col1').removeAttr("checked");
                $('#C1All').removeAttr("checked");
            });

            $('.col1').each(function () {
                $(this).click(function () {
                    var id = $(this).attr('id');
                    debugger
                    var coresId = id.replace('C1', 'C2');
                    $('#' + coresId).removeAttr("checked");
                    $('#C1All').removeAttr("checked");
                    $('#C2All').removeAttr("checked");
                });
            });

            $('.col2').each(function () {
                $(this).click(function () {
                    var id = $(this).attr('id');
                    var coresId = id.replace('C2', 'C1');
                    debugger
                    $('#' + coresId).removeAttr("checked");
                    $('#C1All').removeAttr("checked");
                    $('#C2All').removeAttr("checked");
                });
            });
        });
  </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <div>
            <table border="1">
                <tr>
                    <td>
                        <asp:CheckBox ID="C1All" runat="server" class="col1" Text="approve all" />
                    </td>
                    <td>
                        <asp:CheckBox ID="C2All" runat="server"  class="col2" Text="Reject all" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:CheckBox ID="C101" runat="server" class="col1" Text="john 0" />
                    </td>
                    <td>
                        <asp:CheckBox ID="C201" runat="server"  class="col2" Text="john 0" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:CheckBox ID="C102" runat="server" class="col1" Text="john 1" />
                    </td>
                    <td>
                        <asp:CheckBox ID="C202" runat="server"  class="col2" Text="john all" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:CheckBox ID="C103" runat="server" class="col1" Text="john 2" />
                    </td>
                    <td>
                        <asp:CheckBox ID="C203" runat="server"  class="col2" Text="John 2" />
                    </td>
                </tr>
            </table>
        </div>
    </div>
    </form>
</body>
</html>

i have a two columns (approve all/reject all) how can i restrict the user to allow only one checkbox of each?

here is the output of the screen:

enter image description here

i have tried something like this but did not work:

 function SelectApproveAllCheckboxes(chk, selector) 
    {     
         $('#<%=gv.ClientID%>').find(selector + " input:checkbox").each(function () 
        {                    
              $(this).prop("checked", $(chk).prop("checked"));     
         }); 
    } 
function SelectRejectAllCheckboxes(chk, selector) 
{     
     $('#<%=gv.ClientID%>').find(selector + " input:checkbox").each(function () 
    {                    
          $(this).prop("checked", $(chk).prop("checked"));     
     }); 
}  

<asp:CheckBox ID="chkAll" runat="server" onclick="SelectApproveAllCheckboxes(this, '.approve)" />     
<asp:CheckBox ID="chkAll1" runat="server" onclick="SelectRejectAllCheckboxes(this, '.reject)" />
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T14:42:41+00:00Added an answer on June 3, 2026 at 2:42 pm

    OK based on your answer to my questions on the comments section to your question, here is a working solution. I’ve used a HTML table with static controls; but you should be able to apply the concepts.

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
        <script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <table border="1">
                <tr>
                    <td><input type="checkbox" id="C1All" />Approve All</td>
                    <td><input type="checkbox" id="C2All" />Reject All</td>
                </tr>
                <tr>
                    <td><input type="checkbox" id="C101" class="col1" />John 0</td>
                    <td><input type="checkbox" id="C201" class="col2" />John 0</td>
                </tr>
                <tr>
                    <td><input type="checkbox" id="C102" class="col1" />John 1</td>
                    <td><input type="checkbox" id="C202" class="col2" />John 1</td>
                </tr>
                <tr>
                    <td><input type="checkbox" id="C103" class="col1" />John 2</td>
                    <td><input type="checkbox" id="C203" class="col2" />John 2</td>
                </tr>
            </table>
        </div>
        </form>
        <script type="text/javascript">
            $(document).ready(function () {
                $('#C1All').click(function () {
                    $('.col1').attr("checked", $('#C1All').attr("checked"));
                    $('.col2').removeAttr("checked");
                    $('#C2All').removeAttr("checked");
                });
    
                $('#C2All').click(function () {
                    $('.col2').attr("checked", $('#C2All').attr("checked"));
                    $('.col1').removeAttr("checked");
                    $('#C1All').removeAttr("checked");
                });
    
                $('.col1').each(function () {
                    $(this).click(function () {
                        var id = $(this).attr('id');
                        var coresId = id.replace('C1', 'C2');
                        $('#' + coresId).removeAttr("checked");
                        $('#C1All').removeAttr("checked");
                        $('#C2All').removeAttr("checked");
                    });
                });
    
                $('.col2').each(function () {
                    $(this).click(function () {
                        var id = $(this).attr('id');
                        var coresId = id.replace('C2', 'C1');
                        $('#' + coresId).removeAttr("checked");
                        $('#C1All').removeAttr("checked");
                        $('#C2All').removeAttr("checked");
                    });
                });
            });
        </script>
    </body>
    
    </html>
    

    EDITED

    since in asp.net checkboxes are nested within the span tags make use of this jquery instead of the previous one.

           $(document).ready(function () {
                $('#C1All').click(function () {
                    $('.col1 > input').attr("checked", $('#C1All').attr("checked"));
                    $('.col2 > input').removeAttr("checked");
                    $('#C2All').removeAttr("checked");
                });
    
                $('#C2All').click(function () {
                    $('.col2 > input').attr("checked", $('#C2All').attr("checked"));
                    $('.col1 > input').removeAttr("checked");
                    $('#C1All').removeAttr("checked");
                });
    
                $('.col1').each(function () {
                    $(this).click(function () {
                        var id = $("input", this).attr('id');
                        var coresId = id.replace('C1', 'C2');
                        $('#' + coresId).removeAttr("checked");
                        $('#C1All').removeAttr("checked");
                        $('#C2All').removeAttr("checked");
                    });
                });
    
                $('.col2').each(function () {
                    $(this).click(function () {
                        var id = $("input", this).attr('id');
                        var coresId = id.replace('C2', 'C1');
                        $('#' + coresId).removeAttr("checked");
                        $('#C1All').removeAttr("checked");
                        $('#C2All').removeAttr("checked");
                    });
                });
            });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this simple ASP.NET page here: <%@ Page Language=C# AutoEventWireup=true CodeBehind=Tree.aspx.cs Inherits=CoconutTree.One %>
THIS IS THE SITE.MASTER ASPX PAGE <%@ Master Language=C# AutoEventWireup=true CodeBehind=Site.master.cs Inherits=Prototype4.SiteMaster %> <%@
UPDATED Using RedDot CMS, linking to a 'sub-page' (page within a page) directly will
There was a page with the link http://www.xyzabc.com/exampleone . Then i updated the link
On a masterpage I have my scriptmanager with enablepartialrendering is true. On the page
I've created a UserControl with the following public property: [Browsable(true)] public string Text {
I am calling a thickbox when a link is clicked: <a href=createContact.aspx?placeValuesBeforeTB_=savedValues&TB_iframe=true&height=400&width=550&modal=true title=Add a
What language do I need to learn to be able to update a page
I am working on an updates page where the user can input updates into
I have a web application and on page is an update page to update

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.