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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T06:11:45+00:00 2026-05-11T06:11:45+00:00

I have an ASP.Net UserControl that looks like this: <%@ Control Language=C# AutoEventWireup=true CodeBehind=WebUserControl1.ascx.cs

  • 0

I have an ASP.Net UserControl that looks like this:

<%@ Control Language='C#' AutoEventWireup='true' CodeBehind='WebUserControl1.ascx.cs'     Inherits='WebApplication2.WebUserControl1' %>     <table>         <tr>             <td>                 <asp:Image ID='Image1' runat='server' Width='100' Height='100' ImageUrl='~/Logo.png' />             </td>         </tr>         <tr>             <td>                 Test             </td>         </tr>     </table> 

Additionally I have an ASP web form:

<%@ Page Language='C#' AutoEventWireup='true' CodeBehind='Default.aspx.cs' Inherits='WebApplication2._Default' %> <%@ Register Tagprefix='uc1' Tagname='uc1' Src='.\WebUserControl1.ascx' %>  <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>  <html xmlns='http://www.w3.org/1999/xhtml' > <head runat='server'>     <title></title> </head> <body>     <form id='form1' runat='server'>     <span>         <asp:PlaceHolder ID='PlaceHolder1' runat='server'></asp:PlaceHolder>     </span>     </form> </body> </html> 

When I add several usercontrols at runtime using:

protected void Page_Load(object sender, EventArgs e) {     for (int i = 0; i < 5; i++)     {         var test = LoadControl(@'~\WebUserControl1.ascx');         PlaceHolder1.Controls.Add(test);         }  } 

They are added to the placeholder but aligned one below the other. I’d like them to be placed one next to another. Is this possible and if yes, how?

Regards

  • 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-11T06:11:45+00:00Added an answer on May 11, 2026 at 6:11 am

    Make your table float:right, e.g:

    <table style='float:left'>     ... </table> 

    Or maybe an even cleaner solution: put a div around the contents of your user control and set the div to float:right:

    <%@ Control Language='C#' ... %> <div style='float:right'>   <table>   ... </table> </div> 

    BTW: if the page is not wide enough to display all tables on one row, then they will be wrapped to a new line with this solution.

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

Sidebar

Related Questions

I have a simple asp.net user control: <%@ Control Language=C# AutoEventWireup=true CodeBehind=QueryDefinitionItem.ascx.cs Inherits=xxx.UserControls.QueryDefinitionItem %>
I have a simple ASP.NET Web User Control. It looks like this: <%@ Control
I have asp.net usercontrol that is including some js script like this <script type=text/javascript
I have a very simplistic user control that looks like this: <%@ Control Language=C#
I have an ASP.NET user control (.ascx file). In this user control I want
I have an asp.net usercontrol that contains a jQuery UI Dialog Control. All works
I have an asp.net usercontrol (ascx) that inherits from an abstract class (that inherits
I have a partial view (UserControl) that implements a simple pager in my Asp.Net
I have a UserControl in my Asp.net project that has a public property. I
I have an ASP.NET user control that contains a text box control and a

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.