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. Button Id Problem

Button Id Problem

Scheduled Pinned Locked Moved ASP.NET
helpcsharpjavascriptasp-netquestion
6 Posts 2 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.
  • A Offline
    A Offline
    Ajeet mittal
    wrote on last edited by
    #1

    My application is in Asp.net 2.0. In my applicaton, There is one Repeater contorl. in Repeater there is a button. I have to disable that button with javascript. can any one help me. how can i find bytton id in javascript. thanks

    S 1 Reply Last reply
    0
    • A Ajeet mittal

      My application is in Asp.net 2.0. In my applicaton, There is one Repeater contorl. in Repeater there is a button. I have to disable that button with javascript. can any one help me. how can i find bytton id in javascript. thanks

      S Offline
      S Offline
      Sherin Iranimose
      wrote on last edited by
      #2

      When you want to disable?Or In which event? You need to pass the button id MyButton.ClientID to the JS Function.

      EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.

      A 1 Reply Last reply
      0
      • S Sherin Iranimose

        When you want to disable?Or In which event? You need to pass the button id MyButton.ClientID to the JS Function.

        EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.

        A Offline
        A Offline
        Ajeet mittal
        wrote on last edited by
        #3

        Thanks for replying me. I want to disable it on form button click event. thanks

        S 1 Reply Last reply
        0
        • A Ajeet mittal

          Thanks for replying me. I want to disable it on form button click event. thanks

          S Offline
          S Offline
          Sherin Iranimose
          wrote on last edited by
          #4

          In page load add button1.Attributes.Add("onclick","javascript:DisButton('" & button2.ClientID & "')") JS Function function DisButton(cntrl) { document.getElementById(cntrl).disabled=true; return false; } on button1 click button2 will disable.

          EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.

          A 1 Reply Last reply
          0
          • S Sherin Iranimose

            In page load add button1.Attributes.Add("onclick","javascript:DisButton('" & button2.ClientID & "')") JS Function function DisButton(cntrl) { document.getElementById(cntrl).disabled=true; return false; } on button1 click button2 will disable.

            EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.

            A Offline
            A Offline
            Ajeet mittal
            wrote on last edited by
            #5

            thanks for Reply. but i have to access control id from javascript. like we access another control value. also button on which i have to access javascript is outside the repeater. and i required control id which is in repeater. can u help me in this regards thanks

            S 1 Reply Last reply
            0
            • A Ajeet mittal

              thanks for Reply. but i have to access control id from javascript. like we access another control value. also button on which i have to access javascript is outside the repeater. and i required control id which is in repeater. can u help me in this regards thanks

              S Offline
              S Offline
              Sherin Iranimose
              wrote on last edited by
              #6

              I'm not sure what you are trying to do. You have repeater and that contains a button atleast. say button1 You have an another button thats outside the repeater. say button2 So on button2 click you want to disable the button1. If this is the requirement.... 1.You can use the FindControl function of repeater to get controls inside therepeater, and pass the ID of button1 to the JS function. 2.You can store the ID inside a hidden field and get it in the JS. Hop this Helps you...

              EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.

              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