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 9105613
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T02:08:57+00:00 2026-06-17T02:08:57+00:00

I realize this is a strange/simple question. I have HTML—tables and rows—that make up

  • 0

I realize this is a strange/simple question. I have HTML—tables and rows—that make up a grid. I need the resulting grid to look exactly like the HTML does, with data pulled from a DataTable.

How should I go about doing that? If I replace the HTML with a GridView the result will look different from what I need it to look like. Do I create a custom grid class that spits out tables and rows?

To clarify: I’ve been given an HTML grid…

<div>
    <table>
        <tr>
            <td>row 1 col 1</td>
            <td>row 1 col 2</td>
        </tr>
        <tr>
            <td>row 2 col 1</td>
            <td>row 2 col 2</td>
        </tr>
    </table>
</div>

…which I now need to populate with data from a table, and preserve the original HTML.

  • 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-17T02:08:59+00:00Added an answer on June 17, 2026 at 2:08 am

    If you want to use ASP.Net databinding capabilities, go with a Repeater. The markup will look something like this:

    <table>
        <thead>
             <tr>
                 <th>Heading</th>
             </tr>
        </thead>
        <tbody>
             <asp:Repeater runat="server">
                 <ItemTemplate>
                     <tr>
                         <td><%# Eval("SomeFieldName") %></td>
                     </tr>
                 </ItemTemplate>
             </asp:Repeater>
        </tbody>
    </table>
    

    You can also build the markup manually in the code-behind by instantiating table/row/cell objects and adding them to the controls collection of the page, control, or parent container control. This tends to be time-consuming but it’s a valid option in some cases, such as when you wish to have highly dynamic content that isn’t easy to express in a Repeater.

    A third option is to mix server markup with client markup, e.g.

    <table>
        <thead>
             <tr>
                 <th>Heading</th>
             </tr>
        </thead>
        <tbody>
             <% foreach( var obj in someCollection ){ %>
                 <tr>
                     <td><%= obj.Property %></td>
                 </tr>
             <% } %>
        </tbody>
    </table>
    

    The last option is quite similar (albeit more verbose) to Razor syntax used in ASP.Net MVC views.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I realize this is a basic question but I have searched online, been to
I realize this question is pretty basic, but I'm really stuck. I have a
I realize this question has probably been asked numerous times, but I have not
I realise this is a strange question perhaps, but if say I have a
I realize this one is a bit strange, so I'll explain. For a simple
Ok so I realize that this is a pretty vague question, but bear with
I realize this is more of a hardware question, but this is also very
I realize this is probably a hopelessly newbie question, but what is the difference
I have found this question but it was written in 2009, presumably since then
I have an application that uses OAuth whose logic is something like this: If

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.