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 control to panel Runtime

Add control to panel Runtime

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

    I would like to add a control to a panel during runtime; this is what im doing TextBox str = new TextBox(); str.id = Test; str.Width = Unit.Pixel(100); str.Height = Unit.Pixel(100); this.Panel3.Controls.Add(str); to my suprise this conrol is not being added; does anyone know whats wrong with this code;

    E 1 Reply Last reply
    0
    • O omlac

      I would like to add a control to a panel during runtime; this is what im doing TextBox str = new TextBox(); str.id = Test; str.Width = Unit.Pixel(100); str.Height = Unit.Pixel(100); this.Panel3.Controls.Add(str); to my suprise this conrol is not being added; does anyone know whats wrong with this code;

      E Offline
      E Offline
      eyeseetee
      wrote on last edited by
      #2

      What event are you adding the control in? Page_Load Be careful where the controls are you have to take in to account postback A good article to read would be on Page Life Cycle

      Deliver yesterday, code today, think tomorrow. "http://www.heuse.com/cphumor.htm"

      O 1 Reply Last reply
      0
      • E eyeseetee

        What event are you adding the control in? Page_Load Be careful where the controls are you have to take in to account postback A good article to read would be on Page Life Cycle

        Deliver yesterday, code today, think tomorrow. "http://www.heuse.com/cphumor.htm"

        O Offline
        O Offline
        omlac
        wrote on last edited by
        #3

        Hi, Thank you very much, im page_load event. Thank i will read the article you sent me.

        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