Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8018291
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T21:05:54+00:00 2026-06-04T21:05:54+00:00

At the moment I am trying to create a table whose content is supposed

  • 0

At the moment I am trying to create a table whose content is supposed to be created by a subclass (result of querying a RESTful web service). I have been working for quite some time on that now and I just cannot seem to get it to work. I have tried so many different solutions.

  • creating the table in the subclass and add it to Page.Controls. That gets me “The Controls collection cannot be modified because the control contains code blocks (i.e. <% … %>).” which does not make sense at all.
  • I have tried to create an empty table on the page and passed its handle to the subclass which was responsible for adding rows. Noting happened.
  • I have tried to return a TableRowCollection and assigned it to the previously created (empty) table. Nothing happened.
  • Now I just want to add one row and one cell to the table (baby steps towards what I need). Not even that works. Please find the code for that attached:

    TableRow row = new TableRow();
    table.Rows.Add(row);
    
    TableCell cell = new TableCell();
    row.Cells.Add(cell);
    
    cell.Controls.Add(new TextBox());
    

The table is simple and empty:

<asp:Table ID="table" runat="server" /> 

The source code that is displayed by my browser looks like that:

<table id="table">
</table> 

I have been looking at countless examples on the web and all look like this. I guess it is only a tiny problem somewhere but I have not been able to figure it out. Now I am willing to offer life-long gratitude to everybody who can provide the hint for solving this mess.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T21:05:55+00:00Added an answer on June 4, 2026 at 9:05 pm

    It is working, I have tested it:

    In my page load, I have:

     protected void Page_Load(object sender, EventArgs e)
            {
                TableRow row = new TableRow();
                TableCell cell = new TableCell();
                cell.Controls.Add(new TextBox());
                row.Cells.Add(cell);
                table.Rows.Add(row);
            }
    

    On my aspx page, I have:

    <asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
        <asp:Table ID="table" runat="server" /> 
    </asp:Content>
    

    The html rendered by this code:

    <table id="MainContent_table">
        <tbody><tr>
            <td><input name="ctl00$MainContent$ctl00" type="text"></td>
        </tr>
    </tbody></table>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

At the moment I am trying to create a setup where page content is
I have a modest-sized table, 277k records at the moment, which I am trying
At the moment I'm trying to create a kind of model in vb.net which
I am trying create a small web application that allows a user to login
I am trying to create a procedure which will fill up the table until
I'm trying to create a workflow bar on a web page. The items in
Mjello there! I'm at the moment trying to create a F# application, and now
I've trying to create some stats for my table but it has over 3
I'm currently trying to dynamically create a table using JS and HTML. But at
Im having issues trying to join a table twice. I have 3 tables: Users,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.