[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Adding dynamic controls in html table after certain <tr>

Posted on 2013-05-18
1
Medium Priority
?
409 Views
Last Modified: 2013-05-20
Hi,

I am working on ASP.net 2.0 application using C#

I need to create dynamic control in my html table

<table width="90%" id="tblForm" runat="server">
            <tr id="dynRow" runat="server">
                <td id="dynTD" runat="server">
                </td>
                <td>
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td>hgf
                </td>
                <td>
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="lblText" runat="server" Text="Click button for the text"></asp:Label></td>
                <td>
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Button ID="btnSubmit" runat="server" OnClick="btnSubmit_Click" Text="Submit" /></td>
                <td>
                </td>
                <td>
                </td>
            </tr>
        </table>
            

Open in new window

I am able to create dynamic control as below:
      
TextBox txtBox = new TextBox();
	txtBox.ID = "txtBox1";
	txtBox.Visible = true;

	dynTD.Controls.Add(txtBox);

Open in new window

     
But the problem is I need to add more <tr> after <tr> having id "dynRow"
and then adding controls to it.

Please advise how to find <tr> from table and add further dynamic <tr> after it by adding controls.

Regards,
0
Comment
Question by:tia_kamakshi
1 Comment
 
LVL 36

Accepted Solution

by:
Miguel Oz earned 2000 total points
ID: 39177759
You need to use an asp.net table, check the sample on the links:
http://msdn.microsoft.com/en-us/library/7bewx260(v=vs.100).aspx
http://www.dotnetcurry.com/ShowArticle.aspx?ID=135

Note: Any particular reason for using "table" not asp.net table.
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question