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
E

ema2000_t

@ema2000_t
About
Posts
1
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Creating Textboxes Dynamically
    E ema2000_t

    The problem u have is how to access the dynamically created textboxes, isn't it ok look, the code u had written actually creates a number of objects of type TextBox, and give every one a name that is 'TextBoxName1', 'TextBoxName2',.. etc the problem here is how to access the objects created. so, you must declare a generic dictionary of string and TextBox on the class level, means

    Dictionary AllTextBoxes = new
    Dictionary ();

    this code will be in the class level not inside any methods. the second step is to add a line inside the loop to add items to this dictionary, each of them consists of a key and a value, the key is the name of textbox, while the value is the textbox object created in each loop, this line will be at the end of loop,

    AllTextBoxes.Items.Add("TextBoxName" + i.ToString(), tb);

    now, u can access any textboxe through the dictionary when giving the name of textbox like this

    string aaa = AllTextBoxes["TextBoxName1"].Text;

    I hope this is usefull Dr Sayed Tohamy, Egypt

    ASP.NET database algorithms help
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups