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

Related Questions

Im trying to find a best practice to load usercontrols using Ajax. My first
I'm trying to find out the best practice when removing characters from the start
I am trying to find the best way to design the database in order
I have an interesting query to do and am trying to find the best
Writing my first Linq application, and I'm trying to find the best way to
I'm trying to find out what is the best practice for naming and casing
I am trying to find a best-practice to allow users to define the route
I'm trying to find the best way to speed up the delivery of the
I'm trying to find the best solution for nonblocking IO via stdin/stdout with the
i am trying to find the best way to display results on my page

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.