dynamic create controls

  • Thread starter Thread starter Grey
  • Start date Start date
G

Grey

I know i can use placeholder control for dynamic create controls. but my
requirement is i need to create multiple controls. when the user click the
button, one textbox will be created. If user click three times, there will
be three textbox created. However, just only one textbox was created
whatever times I click.
PLs help.

Million thanks
 
Hi,
You have to recall your create method,
for every previously created textbox on every postback.
And manage states.

Good Luck
Adnan
 
Hi,
Sorry, but i don't have currently any samples.
But, you can search on MSDN Knowledge Base about "Dynamically Create
Controls in ASP.NET ..." (PSS ID Number: 317794 for c# or 317515 for VB
(6/25/2003)).
Or,
If your buttons will shown in a list format,
you could use the DataList or DataGrid control and add a TemplateColumn with
a button in it.
And, adding a new DataRow would be enough to create a new button.
Same as, adding dynamic buttons, but limited on positions.

Good Luck
Adnan
 
Back
Top