Prasad Bolla's SharePoint Blog

Click Here to go through the Interesting posts within my Blog.

Click Here to go through the new posts in my blog.

Friday, February 17, 2012

How to use Asp.Net HTML Table Object Dynamically in Asp.Net

In Asp.Net Form Page Load Write like this.

        TextBox txtFName = new TextBox();
        txtFName.ID = "txtFName";
        this.form1.Controls.Add(txtFName);

        HtmlTable table = new HtmlTable();
        HtmlTableRow tr = new HtmlTableRow();
        HtmlTableCell td = new HtmlTableCell();
        td.InnerText = "Enter FName";
        HtmlTableCell td1 = new HtmlTableCell();
        td1.Controls.Add(txtFName);
        tr.Cells.Add(td);
        tr.Cells.Add(td1);
        table.Rows.Add(tr);
        this.form1.Controls.Add(table);

No comments:

Post a Comment