Dynamically adding UserControl to list in ASP.NET
        Posted  
        
            by darja
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by darja
        
        
        
        Published on 2010-04-20T03:45:48Z
        Indexed on 
            2010/04/20
            3:53 UTC
        
        
        Read the original article
        Hit count: 313
        
ASP.NET
|usercontrols
I have UserControl, which is used for editing fields of some object. I had a page with this control, where user filled the fields, pressed "Submit" and object inserted in DB. And everything was Ok.
But now user wants to insert several objects by one submit. So I need to implement dynamic adding of this control. What is the simpliest way to do it?
The only way I see is to specify "+" button and to create control in its OnClick handler. But it is very dull. I think it is very common issue and there are better variants.
© Stack Overflow or respective owner