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 check boxes and text boxes

How to access the dynamically created check boxes and text boxes

Scheduled Pinned Locked Moved ASP.NET
csharpasp-nethelptutorial
2 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.
  • S Offline
    S Offline
    swapnilbhavsar
    wrote on last edited by
    #1

    Hello I am developing application which creates text-box and check box at run time in asp.net using c#.I am adding checkbox n textbox to panel. as Checkbox chk=new Checkbox(); this.mypanel.controls.add(chk); and text box as Textbox txt=new Textbox(); this.mypanel.controls.add(txt); by this check box get added successfully. but when i am going to get the value of that check box n text box it by Find control then it give me error as "undefined". So I want to access textboxes n checkboxes which r created runtime. Swapnil Bhavsar

    M 1 Reply Last reply
    0
    • S swapnilbhavsar

      Hello I am developing application which creates text-box and check box at run time in asp.net using c#.I am adding checkbox n textbox to panel. as Checkbox chk=new Checkbox(); this.mypanel.controls.add(chk); and text box as Textbox txt=new Textbox(); this.mypanel.controls.add(txt); by this check box get added successfully. but when i am going to get the value of that check box n text box it by Find control then it give me error as "undefined". So I want to access textboxes n checkboxes which r created runtime. Swapnil Bhavsar

      M Offline
      M Offline
      minhpc_bk
      wrote on last edited by
      #2

      What does your sample code look like? The link below may give you some hints: Accessing ASP.NET Controls Programmatically [^] Also, make sure that you should readd the dynamic controls before the postback data is processed, otherwise they get lost, to learn more about this you can see the control life cycle in MSDN.

      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