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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Adding a text box or a control on a webform.

Adding a text box or a control on a webform.

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

    Hi, I have 5 text boxes on my form and I need to add another text box when I click add new button on the form similar to adding a new experience or educational detail in jobsites. Can anyone suggest best way to do it. thanks

    Uday

    N G L 3 Replies Last reply
    0
    • U udaykatakam

      Hi, I have 5 text boxes on my form and I need to add another text box when I click add new button on the form similar to adding a new experience or educational detail in jobsites. Can anyone suggest best way to do it. thanks

      Uday

      N Offline
      N Offline
      N a v a n e e t h
      wrote on last edited by
      #2

      Use GridView/DataGrid where textboxes are placed in a template column. For adding new rows, add new rows to the datasource and rebind grid. This is the easiest method and you won't get any viewstate issues.

      All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions

      1 Reply Last reply
      0
      • U udaykatakam

        Hi, I have 5 text boxes on my form and I need to add another text box when I click add new button on the form similar to adding a new experience or educational detail in jobsites. Can anyone suggest best way to do it. thanks

        Uday

        G Offline
        G Offline
        Gamzun
        wrote on last edited by
        #3

        Create an instance of TextBox and add it to Page's controls collection :) do it in your button's event

        N 1 Reply Last reply
        0
        • G Gamzun

          Create an instance of TextBox and add it to Page's controls collection :) do it in your button's event

          N Offline
          N Offline
          N a v a n e e t h
          wrote on last edited by
          #4

          But you will end up with viewstate issues.

          All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions

          G 1 Reply Last reply
          0
          • N N a v a n e e t h

            But you will end up with viewstate issues.

            All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions

            G Offline
            G Offline
            Gamzun
            wrote on last edited by
            #5

            yeah he has to handle viewstate explicitly

            1 Reply Last reply
            0
            • U udaykatakam

              Hi, I have 5 text boxes on my form and I need to add another text box when I click add new button on the form similar to adding a new experience or educational detail in jobsites. Can anyone suggest best way to do it. thanks

              Uday

              L Offline
              L Offline
              Linda1st
              wrote on last edited by
              #6

              txtBx1 = New TextBox() txtBx1.ID = "TextBox1" txtBx1.Style("Position") = "Absolute" txtBx1.Style("Top") = "755px" txtBx1.Style("Left") = "96px" Form1.Controls.Add(TextBox1) // InitializeComponent() // this is an example on in a table into a placeHolder // go can do the same with the above private HtmlTable insertTblASP( PlaceHolder placeX) { HtmlTable tblx = new HtmlTable(); placeX.Controls.Add(tblx); return tblx; } I hopes this helps. Signed... Linda

              xxx

              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