ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2019 www.aspforums.com. All rights reserved.Dynamically add controls in Table Footer Row using C# and VB.Net in ASP.Net<p>Hi <a class="username" rel="IamAzhar"> IamAzhar</a>,</p> <p>Refer below code.</p> <p><span style="text-decoration: underline;"><strong>Code</strong></span></p> <p><strong>C#</strong></p> <pre class="brush: csharp">protected void Page_Load(object sender, EventArgs e) { if (!this.IsPostBack) { Table tdata = new Table(); TableRow tr = new TableRow(); TableCell tc1 = new TableCell(); Image commentimage1 = new Image(); commentimage1.ID = &#34;commentimage_ &#34;; commentimage1.ImageUrl = &#34;Chrysanthemum.jpg&#34;; commentimage1.Attributes.Add(&#34;class&#34;, &#34;img-thumbnail&#34;); tdata.Style.Add(&#34;width&#34;, &#34;200px&#34;); tdata.Style.Add(&#34;height&#34;, &#34;150px&#34;); commentimage1.Style.Add(&#34;width&#34;, &#34;50px&#34;); commentimage1.Style.Add(&#34;height&#34;, &#34;50px&#34;); tdata.Style.Add(&#34;border&#34;, &#34;1px solid #ccc&#34;); tc1.Style.Add(&#34;padding-top&#34;, &#34;100px&#34;); tc1.Style.Add(&#34;padding-left&#34;, &#34;50px&#34;); TextBox txt = new TextBox(); txt.ID = &#34;txt&#34;; tc1.Controls.Add(commentimage1); tc1.Controls.Add(txt); tr.Controls.Add(tc1); tr.Controls.Add(tc1); tdata.Controls.Add(tr); form1.Controls.Add(tdata); } }</pre> <p><strong>VB.Net</strong></p> <pre class="brush: vb">Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load If Not Me.IsPostBack Then Dim tdata As Table = New Table() Dim tr As TableRow = New TableRow() Dim tc1 As TableCell = New TableCell() Dim commentimage1 As Image = New Image() commentimage1.ID = &#34;commentimage_ &#34; commentimage1.ImageUrl = &#34;Chrysanthemum.jpg&#34; commentimage1.Attributes.Add(&#34;class&#34;, &#34;img-thumbnail&#34;) tdata.Style.Add(&#34;width&#34;, &#34;200px&#34;) tdata.Style.Add(&#34;height&#34;, &#34;150px&#34;) commentimage1.Style.Add(&#34;width&#34;, &#34;50px&#34;) commentimage1.Style.Add(&#34;height&#34;, &#34;50px&#34;) tdata.Style.Add(&#34;border&#34;, &#34;1px solid #ccc&#34;) tc1.Style.Add(&#34;padding-top&#34;, &#34;100px&#34;) tc1.Style.Add(&#34;padding-left&#34;, &#34;50px&#34;) Dim txt As TextBox = New TextBox() txt.ID = &#34;txt&#34; tc1.Controls.Add(commentimage1) tc1.Controls.Add(txt) tr.Controls.Add(tc1) tr.Controls.Add(tc1) tdata.Controls.Add(tr) form1.Controls.Add(tdata) End If End Sub</pre> <p><span style="text-decoration: underline;"><strong>Screenshot</strong></span></p> <p><img src="https://i.imgur.com/iiCkmou.jpg" alt="" width="250" height="327" /></p>https://www.aspforums.net:443/Threads/980726/Dynamically-add-controls-in-Table-Footer-Row-using-C-and-VBNet-in-ASPNet/https://www.aspforums.net:443/Threads/980726/Dynamically-add-controls-in-Table-Footer-Row-using-C-and-VBNet-in-ASPNet/Mon, 29 Jul 2019 06:54:15 GMT