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. creating new control in code behind

creating new control in code behind

Scheduled Pinned Locked Moved ASP.NET
5 Posts 4 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.
  • E Offline
    E Offline
    eyeseetee
    wrote on last edited by
    #1

    Hi, I have the following code: Label lb1 = new Label(); lb1.Text = "test"; but this isnt displaying on my page I know this is very simple, think my brain has gone dead today!! thanks guys.

    W N A 3 Replies Last reply
    0
    • E eyeseetee

      Hi, I have the following code: Label lb1 = new Label(); lb1.Text = "test"; but this isnt displaying on my page I know this is very simple, think my brain has gone dead today!! thanks guys.

      W Offline
      W Offline
      windhopper
      wrote on last edited by
      #2

      Think it may be because your label needs and id?

      "Sex is not the answer, it's the question and the answer is yes"

      1 Reply Last reply
      0
      • E eyeseetee

        Hi, I have the following code: Label lb1 = new Label(); lb1.Text = "test"; but this isnt displaying on my page I know this is very simple, think my brain has gone dead today!! thanks guys.

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

        here is your code. Label mylable = new Label(); mylable.Text = "test"; this.Controls.Add(mylable);

        E 1 Reply Last reply
        0
        • N namn

          here is your code. Label mylable = new Label(); mylable.Text = "test"; this.Controls.Add(mylable);

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

          Thats the one! thanks!

          1 Reply Last reply
          0
          • E eyeseetee

            Hi, I have the following code: Label lb1 = new Label(); lb1.Text = "test"; but this isnt displaying on my page I know this is very simple, think my brain has gone dead today!! thanks guys.

            A Offline
            A Offline
            Anudeep Jaiswal
            wrote on last edited by
            #5

            drag a placeholder and assign the parent property of label to placeholder

            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