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. General Programming
  3. C#
  4. how to display dynamically created controls data in c#

how to display dynamically created controls data in c#

Scheduled Pinned Locked Moved C#
helpcsharptutorialquestion
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.
  • V Offline
    V Offline
    veereshIndia
    wrote on last edited by
    #1

    Hi All, Iam creating a table dynamically with this structure Rno Name Address 1 xyz TextBox1 2 yzx TextBox2 3 aaa TextBox3 Now the user enters data into text boxs.I want to get those data.How can i do this.Iam creating textbox id's dynamically.This is my code for (int i = 0; i < 10; i++) { string boxName = "monthData" + (i).ToString(); TextBox tb = form1.FindControl(boxName) as TextBox; string txt = tb.Text.ToString(); Response.Write(txt.ToString()); } Iam accessing id's of text box's but there is an error "Object reference not set to an instance of the object" in string txt = tb.Text.ToString(). Please help me on this.

    i want to join this group

    I 1 Reply Last reply
    0
    • V veereshIndia

      Hi All, Iam creating a table dynamically with this structure Rno Name Address 1 xyz TextBox1 2 yzx TextBox2 3 aaa TextBox3 Now the user enters data into text boxs.I want to get those data.How can i do this.Iam creating textbox id's dynamically.This is my code for (int i = 0; i < 10; i++) { string boxName = "monthData" + (i).ToString(); TextBox tb = form1.FindControl(boxName) as TextBox; string txt = tb.Text.ToString(); Response.Write(txt.ToString()); } Iam accessing id's of text box's but there is an error "Object reference not set to an instance of the object" in string txt = tb.Text.ToString(). Please help me on this.

      i want to join this group

      I Offline
      I Offline
      il_masacratore
      wrote on last edited by
      #2

      Maybe because you're starting iteration with i=0? Start with 1.

      Visit my blog at http://dotnetforeveryone.blogspot.com

      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