A
alun65
I've been implementing some paging links that I would like at the
bottom and top of a result set, I build up the required HTML in the
code behind then add it to the placeholder.
This works fine when there only one placeholder on the page but as
soon as I add another it seems to all about the last placeholder
control.
I've got a simple example which illustrates my point, here we add a
link to the page via the code behind then add it to two
Placeholder's, but we only see it output once.
Default.aspx.cs
------------------------
protected void Page_Load(object sender, EventArgs e)
{
HtmlAnchor Link = new HtmlAnchor();
Link.InnerText = "1 ";
Placeholder1.Controls.Add(Link);
Placeholder2.Controls.Add(Link);
}
Default.aspx
-----------------
<asplaceholder ID="Placeholder1" runat="server"></asplaceholder>
<asplaceholder ID="Placeholder2" runat="server"></asplaceholder>
Expected output
bottom and top of a result set, I build up the required HTML in the
code behind then add it to the placeholder.
This works fine when there only one placeholder on the page but as
soon as I add another it seems to all about the last placeholder
control.
I've got a simple example which illustrates my point, here we add a
link to the page via the code behind then add it to two
Placeholder's, but we only see it output once.
Default.aspx.cs
------------------------
protected void Page_Load(object sender, EventArgs e)
{
HtmlAnchor Link = new HtmlAnchor();
Link.InnerText = "1 ";
Placeholder1.Controls.Add(Link);
Placeholder2.Controls.Add(Link);
}
Default.aspx
-----------------
<asplaceholder ID="Placeholder1" runat="server"></asplaceholder>
<asplaceholder ID="Placeholder2" runat="server"></asplaceholder>
Expected output