Dynamic form generation is possible but does require some careful attention.
One way to add controls to a form is add a container object in design time
to your web form or user control.
There's an Add method that almost available in all the container type
controls in asp.net. For example, HTML and ASP Tables, placeholders, etc.
Use this control to dynamically add what ever server controls you want.
But the trick is the event handler wire up. You'd have to wire the event
hanlder methods to the events every time a page is loaded for a dynamically
added control.
If you are using C# look at the InitializeComponent method. You should have
a event handler wire up to a method for atleast the page Load event. That
should give you an idea of how to manually wire the events.
HTH,
Suresh.
"Ed" wrote:
Hallo,
How to do such a thing:
I want to build an ASP.NET application and I want to keep
it so flexible how possible. So I want the APS.NET for
example to render the buttons according to some database
entry (in database I have something like
that "b1,b2,b8,b10" and this time our page has buttons
number 1, 2, 8, 10), and I want to by able at run time to
decide what functionality these buttons have (so the
database tells us that after clicking on b1 there will by
method m3 started, and so on). How can it by done? Of
course I'm looking for the easiest and most professional
way ;)
Best regars,
Ed