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. How to access the dynamically created control

How to access the dynamically created control

Scheduled Pinned Locked Moved ASP.NET
helptutorial
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.
  • D Offline
    D Offline
    deepseeindeepsy
    wrote on last edited by
    #1

    Hello Sir, I have created dynamic table which contains textboxes which counts equal to the value in the text box (for entering number of rows to show) on the page & hence appears it. Now, I want that when user click to any of the textbox, I want to have its ID so that I will work on it further OR how to know which textbox have been focused. I m not getting any idea as it is dynamic control. Please help me! Thanx. :)

    R C 2 Replies Last reply
    0
    • D deepseeindeepsy

      Hello Sir, I have created dynamic table which contains textboxes which counts equal to the value in the text box (for entering number of rows to show) on the page & hence appears it. Now, I want that when user click to any of the textbox, I want to have its ID so that I will work on it further OR how to know which textbox have been focused. I m not getting any idea as it is dynamic control. Please help me! Thanx. :)

      R Offline
      R Offline
      rhtbhegade
      wrote on last edited by
      #2

      When u dynamically add control.at the same time u also add id for each of the textbox in for loop..and then access the id(i.e TextBox) which u want.....

      Sharing Of Knowledge Provides Solution....

      D 1 Reply Last reply
      0
      • D deepseeindeepsy

        Hello Sir, I have created dynamic table which contains textboxes which counts equal to the value in the text box (for entering number of rows to show) on the page & hence appears it. Now, I want that when user click to any of the textbox, I want to have its ID so that I will work on it further OR how to know which textbox have been focused. I m not getting any idea as it is dynamic control. Please help me! Thanx. :)

        C Offline
        C Offline
        Christian Graus
        wrote on last edited by
        #3

        The big issue with dynamic controls is that if you don't create them before page load, they have no viewstate.

        Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

        D 1 Reply Last reply
        0
        • R rhtbhegade

          When u dynamically add control.at the same time u also add id for each of the textbox in for loop..and then access the id(i.e TextBox) which u want.....

          Sharing Of Knowledge Provides Solution....

          D Offline
          D Offline
          deepseeindeepsy
          wrote on last edited by
          #4

          Rohit, I have did it otherwise, text boxes wud not appeared on the page.

          C 1 Reply Last reply
          0
          • D deepseeindeepsy

            Rohit, I have did it otherwise, text boxes wud not appeared on the page.

            C Offline
            C Offline
            Christian Graus
            wrote on last edited by
            #5

            I suspect your question is not clear. If you want to access the controls on the client side, you need to pass the ClientID property through to javascript on the client side. This would be the same no matter how they were created.

            Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

            1 Reply Last reply
            0
            • C Christian Graus

              The big issue with dynamic controls is that if you don't create them before page load, they have no viewstate.

              Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

              D Offline
              D Offline
              deepseeindeepsy
              wrote on last edited by
              #6

              Ok Sir, but I just want to track which txt box has been focused , or hovering or clicking it a msg to show or will go to the redirected page. It will also work. Your excellency. :)

              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