Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. CheckAll/Uncheck all

CheckAll/Uncheck all

Scheduled Pinned Locked Moved ASP.NET
csharpasp-net
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kibromg
    wrote on last edited by
    #1

    I have a gridview that contains a checkbox for a user to select his choice. I want a code that enables user to check all and uncheck the check box at ones I am using ASP.net and C_sharp.And this should be done with out postback. Please advice

    S S 2 Replies Last reply
    0
    • K kibromg

      I have a gridview that contains a checkbox for a user to select his choice. I want a code that enables user to check all and uncheck the check box at ones I am using ASP.net and C_sharp.And this should be done with out postback. Please advice

      S Offline
      S Offline
      sam
      wrote on last edited by
      #2

      use javascript. and performe your job in a java script function

      1 Reply Last reply
      0
      • K kibromg

        I have a gridview that contains a checkbox for a user to select his choice. I want a code that enables user to check all and uncheck the check box at ones I am using ASP.net and C_sharp.And this should be done with out postback. Please advice

        S Offline
        S Offline
        sidbaruah
        wrote on last edited by
        #3

        javascript will solve it!! but one thing,the id of the controls inside the gridview is different from the server controls!!!! In the page check the id of the checkboxes with viewsource of the page!!! Write the javascript accordingly!!!! Hope itll help!!!

        I was born dumb!! :laugh:Programming made me laugh:laugh:!!! --sid--

        K 1 Reply Last reply
        0
        • S sidbaruah

          javascript will solve it!! but one thing,the id of the controls inside the gridview is different from the server controls!!!! In the page check the id of the checkboxes with viewsource of the page!!! Write the javascript accordingly!!!! Hope itll help!!!

          I was born dumb!! :laugh:Programming made me laugh:laugh:!!! --sid--

          K Offline
          K Offline
          kibromg
          wrote on last edited by
          #4

          Could you give me a code in javascript and how to incorporate in in to my ASP.net,C sharp? I havent used Javascript before. Thanks for your help

          S 1 Reply Last reply
          0
          • K kibromg

            Could you give me a code in javascript and how to incorporate in in to my ASP.net,C sharp? I havent used Javascript before. Thanks for your help

            S Offline
            S Offline
            sidbaruah
            wrote on last edited by
            #5

            FUNCTION FUNC_NAME() { VAR CHK=DOCUMENT.GETELEMENTBYID("CHECK BOX NAME"); VAR COUNT="COUNT_OF_CHECKBOXES"; WHILE(COUNT>0) { IF(CHK.CHECKED==TRUE) { CHK1.CHECKED=TRUE; } ELSE { CHK1.CHECKED=FALSE; } } IN THE CODE CHECK_ALL_CHECK_BOX.ATTRIBUTES.ADD("ONCLICK","RETURN FUNC_NAME();"); HOPE IT HELPS!!!!

            I was born dumb!! :laugh:Programming made me laugh:laugh:!!! --sid--

            K 1 Reply Last reply
            0
            • S sidbaruah

              FUNCTION FUNC_NAME() { VAR CHK=DOCUMENT.GETELEMENTBYID("CHECK BOX NAME"); VAR COUNT="COUNT_OF_CHECKBOXES"; WHILE(COUNT>0) { IF(CHK.CHECKED==TRUE) { CHK1.CHECKED=TRUE; } ELSE { CHK1.CHECKED=FALSE; } } IN THE CODE CHECK_ALL_CHECK_BOX.ATTRIBUTES.ADD("ONCLICK","RETURN FUNC_NAME();"); HOPE IT HELPS!!!!

              I was born dumb!! :laugh:Programming made me laugh:laugh:!!! --sid--

              K Offline
              K Offline
              kibromg
              wrote on last edited by
              #6

              Thanks very much.Where will i put the code in the (.aspx) for the page together with the HTML. or somewhere else... Please advice Thanks for your time

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups