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. Datalist control

Datalist control

Scheduled Pinned Locked Moved ASP.NET
javascripthelpquestion
9 Posts 5 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.
  • V Offline
    V Offline
    Vijayitsb
    wrote on last edited by
    #1

    Hi friends, I am using datalist controls.I want to access that control using javascript.Is it possible ? How can do this. plz help me

    Thank& Regards Vijay s

    N S J P 5 Replies Last reply
    0
    • V Vijayitsb

      Hi friends, I am using datalist controls.I want to access that control using javascript.Is it possible ? How can do this. plz help me

      Thank& Regards Vijay s

      N Offline
      N Offline
      N a v a n e e t h
      wrote on last edited by
      #2

      A datalist control will be rendered as HTML table or div tags. Why do you want to access them through JS ?

      All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions

      V 1 Reply Last reply
      0
      • V Vijayitsb

        Hi friends, I am using datalist controls.I want to access that control using javascript.Is it possible ? How can do this. plz help me

        Thank& Regards Vijay s

        S Offline
        S Offline
        Sun Rays
        wrote on last edited by
        #3

        Hi, can you explain for what purpose you want to do so ? Descriptive message plz....

        Thanks, Sun Rays Rate this post if you like answer. My Articles

        1 Reply Last reply
        0
        • V Vijayitsb

          Hi friends, I am using datalist controls.I want to access that control using javascript.Is it possible ? How can do this. plz help me

          Thank& Regards Vijay s

          J Offline
          J Offline
          John ph
          wrote on last edited by
          #4

          Vijayitsb wrote:

          I want to access that control using javascript.Is it possible ?

          you can access any control on the client-side through JavaScript using the following statement document.getElementById(ClientID). Note: Every child control placed in the DataList will have a Unique clientId for each item.

          - Regards -
             JON


          Life is not measured by the amount of breaths we take, but by the moments that take our breath away.


          1 Reply Last reply
          0
          • N N a v a n e e t h

            A datalist control will be rendered as HTML table or div tags. Why do you want to access them through JS ?

            All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions

            V Offline
            V Offline
            Vijayitsb
            wrote on last edited by
            #5

            Because I am using checkbox in DataList.If i click checkall button all checkbox are selected.I have done this in server side.but i like to do this in client side

            Thank& Regards Vijay s

            N 1 Reply Last reply
            0
            • V Vijayitsb

              Hi friends, I am using datalist controls.I want to access that control using javascript.Is it possible ? How can do this. plz help me

              Thank& Regards Vijay s

              S Offline
              S Offline
              Sun Rays
              wrote on last edited by
              #6

              Hi, check this.. http://forums.asp.net/t/1014000.aspx[^]

              Thanks, Sun Rays Rate this post if you like answer. My Articles

              1 Reply Last reply
              0
              • V Vijayitsb

                Because I am using checkbox in DataList.If i click checkall button all checkbox are selected.I have done this in server side.but i like to do this in client side

                Thank& Regards Vijay s

                N Offline
                N Offline
                N a v a n e e t h
                wrote on last edited by
                #7

                Vijayitsb wrote:

                but i like to do this in client side

                In the "Check all" check box call a JS function from Onclick event. Loop through all datalist records and check the other checkboxes. To get how many rows datalist have, keep a public variable and assign the row count to there. You can take this variable value to JS and start loop.

                All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions

                1 Reply Last reply
                0
                • V Vijayitsb

                  Hi friends, I am using datalist controls.I want to access that control using javascript.Is it possible ? How can do this. plz help me

                  Thank& Regards Vijay s

                  P Offline
                  P Offline
                  Prateek G
                  wrote on last edited by
                  #8

                  you dont need to access datalist control to access checkBox you just need to send number of rows for ur purpose and then loop through all the rows.. for(var rowNum=1; rowNum<=parseInt(TotalRows,10); rowNum++) { if(document.getElementById('checkBox'+rowNum).checked = true; } I guess this code can help u out..

                  V 1 Reply Last reply
                  0
                  • P Prateek G

                    you dont need to access datalist control to access checkBox you just need to send number of rows for ur purpose and then loop through all the rows.. for(var rowNum=1; rowNum<=parseInt(TotalRows,10); rowNum++) { if(document.getElementById('checkBox'+rowNum).checked = true; } I guess this code can help u out..

                    V Offline
                    V Offline
                    Vijayitsb
                    wrote on last edited by
                    #9

                    Thanks

                    Thank& Regards Vijay s

                    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