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. Add Controls in runtime

Add Controls in runtime

Scheduled Pinned Locked Moved ASP.NET
tutorialquestion
4 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.
  • N Offline
    N Offline
    nesaraja
    wrote on last edited by
    #1

    Hi All, How to add controls(textbox,dropdownlist and etc)into the webpage in runtime .? And how to handle the events of these controls? Just add the control in form not in Panels Pls give me suggession with sample code. thanks paul Paul -- modified at 3:08 Thursday 20th April, 2006

    M 1 Reply Last reply
    0
    • N nesaraja

      Hi All, How to add controls(textbox,dropdownlist and etc)into the webpage in runtime .? And how to handle the events of these controls? Just add the control in form not in Panels Pls give me suggession with sample code. thanks paul Paul -- modified at 3:08 Thursday 20th April, 2006

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

      Adding Controls to a Web Forms Page Programmatically[^] Creating an Event Handler at Run Time in Web Forms Pages[^] When working with dynamic controls, you should understand the Control Execution Lifecycle[^].

      N 1 Reply Last reply
      0
      • M minhpc_bk

        Adding Controls to a Web Forms Page Programmatically[^] Creating an Event Handler at Run Time in Web Forms Pages[^] When working with dynamic controls, you should understand the Control Execution Lifecycle[^].

        N Offline
        N Offline
        nesaraja
        wrote on last edited by
        #3

        Thanks for your sugession. how to add the control into form..(Not in Panel and placeholder) -- modified at 4:34 Thursday 20th April, 2006

        M 1 Reply Last reply
        0
        • N nesaraja

          Thanks for your sugession. how to add the control into form..(Not in Panel and placeholder) -- modified at 4:34 Thursday 20th April, 2006

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

          nesaraja wrote:

          how to add the control into form..(Not in Panel and placeholder)

          Get reference to the Form control, and add the dynamic control to the form. then i guess your next question will be "How do I get reference to the Form?" :-D. Ok, here are two ways: + With the ASP.NET 2.0, use the Page.Form[^] property. + With the ASP.NET 1.x, make sure the form tag has the runat="server" stuff, then you can declare the HtmlForm[^] instance in code-behind, and use it as you would with a normal object.

          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