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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T21:35:52+00:00 2026-05-23T21:35:52+00:00

I’ve inherited an ASP.net web application where the previous developer used the convention of

  • 0

I’ve inherited an ASP.net web application where the previous developer used the convention of having an ASP.net GridView for each table that displays data to the user, even if it is not a page that will take advantage of paging or viewstate in any way.

I’ve become a bit fed up with some of the limitationsand cruft associated with GridView and I’m thinking of rolling my own on some pages.

My questions: “Is this a good idea?” “What are the pitfalls?”

My code looks like this:

   <table>
        <%=EquipmentTableHeadingsRowHTML() %>
        <%foreach(Entry entry in TableEntries)
          { %>
            <%=WriteTableRowForEntry(entry) %>
       <% } %>
   </table>

    public string WriteTableRowForEntry(Entry entry)
    {
        StringBuilder sb = new StringBuilder();
        sb.Append("<tr><td>");
        sb.Append(entry.Description);
        sb.Append("</td><td>");
        sb.Append(entry.NumberRequired);
        sb.Append("</td><td>");
        sb.Append(entry.NumberCurrent);
        sb.Append("</td><td>");
        sb.Append(entry.NumberRequired);
        sb.Append("</td><td>");
        sb.Append(entry.CostEach);
        sb.Append("</td><td>");
        sb.Append("TOTAL COST");
        sb.Append("</td></tr>");
        return sb.ToString();
    }
  • 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-05-23T21:35:53+00:00Added an answer on May 23, 2026 at 9:35 pm

    That’s funny.. I just inherited code written by a third party and was going to send it back to them telling them to use a Repeater or a List, but then I realized that they were using a couple of java script frameworks that rely on predictable IDs. Older versions of the .NET framework don’t allow much flexibility in specifying the IDs of server controls. The 3rd party developer created htmlElements in a loop in code-behind to compensate, so she had a good reason in this case.

    The short answer, based on this new experience is that generating tables (or other repeatable content) in code-behind is, in my opinion, not a good thing. It’s more difficult to read the code, and defeats the purpose of having DataBound controls, so it’s a poor use of the platform, BUT if there is a good reason, then an exception can be made.

    In THIS code example, I think it’s a bad thing.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I used javascript for loading a picture on my website depending on which small
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a French site that I want to parse, but am running into
We're building an app, our first using Rails 3, and we're having to build

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.