Creating webcontrols on the fly

F

Fabiano

Please,

I need to create an webpage that when user clicks on ADD button it's create
a new line with dropdownlist, textboxes and on.
with ASP and HTML i use DHTML to create another controls. Now with ASP.NET
and C# how can i do this. May i use DHTML or can i do this on my codebehind?

Tks in adv.

Fabiano
 
A

Alvin Bruney [MVP]

codebehind will work
dropdownlist d = new dropdownlist();
Form1.controls.add(d);

roughly
 
S

Scott Mitchell [MVP]

Fabiano said:
I need to create an webpage that when user clicks on ADD button it's create
a new line with dropdownlist, textboxes and on.
with ASP and HTML i use DHTML to create another controls. Now with ASP.NET
and C# how can i do this. May i use DHTML or can i do this on my codebehind?

Fabiano, check out:

Dynamic Controls in ASP.NET
http://aspnet.4guysfromrolla.com/articles/081402-1.aspx

And:

Working with Dynamically Created Controls
http://aspnet.4guysfromrolla.com/articles/082102-1.aspx

Happy Programming!

--

Scott Mitchell
(e-mail address removed)
http://www.4GuysFromRolla.com
http://www.ASPFAQs.com
http://www.ASPMessageboard.com

* When you think ASP, think 4GuysFromRolla.com!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top