How to dynamically add controls in asp.net Dynamic Data

Posted by loviji on Stack Overflow See other posts from Stack Overflow or by loviji
Published on 2010-04-22T05:56:40Z Indexed on 2010/04/22 6:13 UTC
Read the original article Hit count: 379

Hello, i'm trying to work with asp.NET Dynamic Data. So, I see asp.NET Dynamic Data not well learned by people as other technologies. now, to my question. Lets us work with Details.aspx page that located on ~\DynamicData\PageTemplates I need to add <asp:DynamicControl runat="server" to page into Form1.detailsTable.

i've tried like this:

   protected DynamicControl myC=new DynamicControl();

protected void Page_Load(object sender, EventArgs e)
{
    foreach(var c in table.Columns)
    {
       myC.DataField=c.DisplayName;
       FormView1.Controls.Add(myC);
    }


}

but I can not see the desired result. where is the problem. thanks

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about asp.net-dynamic-data