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. how to add textbox to a table at runtime and send textbox's value to database

how to add textbox to a table at runtime and send textbox's value to database

Scheduled Pinned Locked Moved ASP.NET
databasehelptutorial
4 Posts 3 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.
  • S Offline
    S Offline
    sanchet
    wrote on last edited by
    #1

    hello, i am trying to find out "how to add a simple textbox to a form at runtime and then send its textvalue(whatever written in it) to a datatable made in my dadabase" is anybody can help me! thanx in advance! nitin

    S S 2 Replies Last reply
    0
    • S sanchet

      hello, i am trying to find out "how to add a simple textbox to a form at runtime and then send its textvalue(whatever written in it) to a datatable made in my dadabase" is anybody can help me! thanx in advance! nitin

      S Offline
      S Offline
      Sandeep Akhare
      wrote on last edited by
      #2

      Add a placeholder control where you want to add the textbox then at run time create the new object of your textbox give it id and then add that textbox to the placeholder . now the control is in page you can use that value

      Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

      1 Reply Last reply
      0
      • S sanchet

        hello, i am trying to find out "how to add a simple textbox to a form at runtime and then send its textvalue(whatever written in it) to a datatable made in my dadabase" is anybody can help me! thanx in advance! nitin

        S Offline
        S Offline
        Sreekumar P P
        wrote on last edited by
        #3

        Nitin, sandip is right... However, you can also use "Panels" for the same protected System.Web.UI.WebControls.Panel Panel1; ... ... .... .... TextBox txt =new TextBox(); txt.ID = "textBox1"; Panel1.Controls.Add(txt); ... ... .... .... //At any point of time you can read value from this text box TextBox tempText = new TextBox() tempText = (TextBox)Panel1.FindControl("textBox1") string strValue = tempText.Text() Sreekumar P P

        S 1 Reply Last reply
        0
        • S Sreekumar P P

          Nitin, sandip is right... However, you can also use "Panels" for the same protected System.Web.UI.WebControls.Panel Panel1; ... ... .... .... TextBox txt =new TextBox(); txt.ID = "textBox1"; Panel1.Controls.Add(txt); ... ... .... .... //At any point of time you can read value from this text box TextBox tempText = new TextBox() tempText = (TextBox)Panel1.FindControl("textBox1") string strValue = tempText.Text() Sreekumar P P

          S Offline
          S Offline
          sanchet
          wrote on last edited by
          #4

          thanx sir ji, your view is very helpful 4 me but there is a prblm now... i put 2 btn on form btn1.text= add button btn2.text= insert when i click btn1 , a textbox appeared on forn but when i click btn2 the textbox disappear and nothing inserted in my database. nitin

          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