Hi,
I have a ASP 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 a asp page:
<%@ 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 sveral the 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