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. Dynamic Control

Dynamic Control

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

    I have a problem to add a dynamic control to my page i add the fllow code to Page_load() Whats the problem ?? Button img = new Button(); img.Width = 15; img.Height = 15; HtmlForm form1 = this.FindControl("Form1") as HtmlForm; form1.Controls.Add(img); No thing add to the page ??? With Thanks MHF

    A 1 Reply Last reply
    0
    • M MHASSANF

      I have a problem to add a dynamic control to my page i add the fllow code to Page_load() Whats the problem ?? Button img = new Button(); img.Width = 15; img.Height = 15; HtmlForm form1 = this.FindControl("Form1") as HtmlForm; form1.Controls.Add(img); No thing add to the page ??? With Thanks MHF

      A Offline
      A Offline
      Andrei_KS
      wrote on last edited by
      #2

      Hi, I think you must use PlaceHolder control how container. For example: protected void Page_Load(object sender, EventArgs e) { Button img = new Button(); img.Width = 15; img.Height = 15; img.Click += new EventHandler(img_Click); mPlaceHolder.Controls.Add(img); }

      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