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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T00:40:09+00:00 2026-05-11T00:40:09+00:00

I am trying to find the best practice for generating and outputting html which

  • 0

I am trying to find the best practice for generating and outputting html which would require a database query first to obtain the info. Currently in the aspx page I have a div with runat server:

<div runat='server' id='leaflet'></div> 

Now just as a start to do a bit of testing I have a method that runs on page_load that basically does:

private void BuildLeaflet(string qnid)     {     //gets leaflet details     QueryLeafletDetails();     //return concatenated content string     leaflet.InnerHtml '<h1>' + dr['LSC Descriptor'] + '</h1>';     } 

In the real solution the return is a concatenation of about 10 fields some very long as they are content.

I don’t by any means think this is the best solution, but what is? A StringBuilder? Can I Write Each Part in turn to the site avoiding the concatenation in the method? Is the server div even best?

Edit: Forgot to put some of my content sections have simple (limited) html in them already such as paragraph, list… This allows me to easily produce documents for web and printing, I just use different stylesheets.

  • 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. 2026-05-11T00:40:10+00:00Added an answer on May 11, 2026 at 12:40 am

    I would use <asp:Literal runat='server' enableViewState='false' id='leaflet' />. This doesn’t generate any tags on the page, and doesn’t stuff all the text in the ViewState.

    And yes, use StringBuilder if you need to concatenate many long strings. This will be way more memory efficient.

    The other solution would be to see if you can make some fixed markup on the page and put the contents of each DB field in it’s own control (<asp:Literal />?).

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

Sidebar

Ask A Question

Stats

  • Questions 174k
  • Answers 174k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You can force PowerShell into returning an array, even when… May 12, 2026 at 2:51 pm
  • Editorial Team
    Editorial Team added an answer Zend Framework is a use-at-will framework, which allows you to… May 12, 2026 at 2:51 pm
  • Editorial Team
    Editorial Team added an answer Is your Windows Firewall turned on? May 12, 2026 at 2:51 pm

Related Questions

I am trying to numerically integrate an arbitrary (known when I code) function in
I'm very new to multi-threading and for some reason this class is giving me
I'm having an issue coming up with a good way to do the following.
I am working on an ASP.NET MVC application that contains a header and menu

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.