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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T13:28:28+00:00 2026-05-11T13:28:28+00:00

I have a program that displays messages posted to a forum. Right now, I

  • 0

I have a program that displays messages posted to a forum. Right now, I am using the Response.Write method in the code behind to insert the HTML I want. But I would much rather avoid putting HTML in the code behind (because it is not in the spirit of the whole code behind/design separation feature of .NET). I would like to use a content placeholder, and insert child controls dynamically. However, I can only seem to insert them side by side, and one after another. I would like to have something that looks like this:

Table Column 1       Table Column 2
Username: [UserName]      
[MessageSubject]
Posted on: [PostDate]
User Rating: [UserRating]

But the only thing I can seem to accomplish is:

Username: [UserName]Posted On: [PostDate] User Rating [UserRating][MessageSubject], without links or formatting.

How do I put paragraphs, line breaks, form buttons and regular hyperlinks into a content placeholder, and make them align the way I want them to?

  • 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-11T13:28:28+00:00Added an answer on May 11, 2026 at 1:28 pm

    You do it much the same way as you would int the .aspx page, for example:

    Table table = new Table(); TableRow row1 = new TableRow(); table.Rows.Add(row1); TableCell cell1 = new TableCell(); TableCell cell2 = new TableCell(); row1.Cells.Add(cell1); row1.Cells.Add(cell2); Label label1 = new Label(); label1.Text = 'Username:'; cell1.Controls.Add(label1); TextBox textBox1 = new TextBox(); textBox1.ID = 'userNameTextBox'; cell2.Controls.Add(textBox1); // and so on... myPlaceholder.Controls.Add(table); 

    would be equivalent to:

    <asp:Table runat='server'>   <asp:TableRow runat='server'>     <asp:TableCell runat='server'>       <asp:Label runat='server' Text='Username:' />     </asp:TableCell>     <asp:TableCell runat='server'>       <asp:TextBox runat='server' ID='userNameTextBox' />     </asp:TableCell>   </asp:TableRow> </asp:Table> 

    Of course the code could be cleverer, this is just to illustrate the point. Any hierarchy of controls you can build declaratively to control you layout, you can do programatically too.

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

Sidebar

Related Questions

I have to code a Java program that will receive messages from network and
I have a chat program that displays I list of online users. The message
I have a program that displays and inventory report and i was just wondering
I have a C# program that displays a list of patients with medications where
I have a program that receives webcam video and displays it on a C#
I have a program that occasionally pops up on the screen and displays a
I have written a simple OpenGL program in C++ that displays a line joining
Hi I have a small problem. I am coding a program that displays the
I have a JSP program that displays a form where the user enters some
I have written a simple MSN -style program that will send and retrieve messages

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.