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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T17:39:44+00:00 2026-06-12T17:39:44+00:00

Which is the best way to load text into a webpage using ASP.NET I

  • 0

Which is the best way to load text into a webpage using ASP.NET

I have 3 records in a MS SQL database table. Each record would correspond to a paragraph in a webpage.

Table:

enter image description here

The HTML code for the About us page would look like this (note I put the corresponding paragraphs) :

<div id="content-1b">
    <div id="content-1-1b">
        </div>
    <div id="content-1-2b"><p class="none">paragraph 1</p>
                           <p class="nonetop">paragraph 2</p>
        </div>
</div>

<div id="content-3b"><p class="nonetop">paragraph 3</p>
    </div>

Regards,
Tea

  • 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-12T17:39:46+00:00Added an answer on June 12, 2026 at 5:39 pm

    Setting your divs or paragraph tags as runat=”server” with an ID will allow you to access innerhtml/text

    HTML:

    <div id="content-1b">
        <div id="content-1-1b">
            </div>
        <div id="content-1-2b"><p class="none" id="p1" runat="server">paragraph 1</p>
                               <p id="p2" runat="server" class="nonetop">paragraph 2</p>
            </div>
    </div>
    
    <div id="content-3b"><p id="p3" runat="server" class="nonetop">paragraph 3</p>
        </div>
    

    Running code like: (assuming your content is in a datatable and that you want the first item (0) from each row)

    For each row as Datarow in dt
         p1.InnerHtml += Row.Item(0).ToString
    Next
    

    Will loop through your datatable, get the first column from each row and append the text to the paragraph tag.

    Update:

    For Single Content

    If your SQL returns 3 rows, 1 for each area you want to fill simply do:

    Assuming dt is the datatable you are filling and that the first column of each row is your content.

    p1.InnerHTML = dt.rows(0).Item(0)
    p2.InnerHTML = dt.rows(1).Item(0)
    p3.InnerHTML = dt.rows(2).Item(0)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a this asp.net page which upon first time load: 1: Make a
Which is the best way to read and parse an Fixed Width Text File
Which is the best way to perform the following: Lets say i have a
I have 1000 records in a table which holds position field starting from 1
I have made an application in javascript using HTML fields in asp.net, as asp
I am learning asp.net and needed to have a CheckBoxList which items will be
I’m trying to decide the best way to load data into my app, it’s
I have a site that I am currently working on in ASP.NET 2.0 using
I have a list of values in a SQL Table which are used to
Which is the best way of implementing a language translation for mutli -lang site.

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.