Reputation: 425
I have a placholder that I dont just want to use Visible="false" on, becouse it reserv some space on the page. I dont want the space reservation. How can I do that? Maybe use somethingels?
<asp:DataList ID="ImageList" runat="server" RepeatDirection="Horizontal" EditItemStyle-VerticalAlign="Top"
RepeatColumns="4">
<ItemTemplate>
<asp:PlaceHolder ID="phImage" runat="server" Visible="false">
<div class="prodImagesBorder"> "SOME STUFF with auto length and width"
<div class="prodImages"> "SOME STUFF"
<div class="thumbnail"> "SOME STUFF"
</div>
</div>
</div>
</asp:PlaceHolder>
</ItemTemplate>
</asp:DataList>
Codebehind:
if(ImageTabel.Rows[i]["ImgUrl"].ToString() != lblOldImgUrl.Text)
{
PlaceHolder phImage = (PlaceHolder)ImageList.Items[i].FindControl("phImage");
phImage.Visible=true;
}
Upvotes: 0
Views: 1689
Reputation: 124804
A PlaceHolder
does not render a tag - it's just a container for other server controls. So there's no tag on which you can set display:none
.
Upvotes: 1
Reputation: 3494
elements with the CSS style display:None will take up no space. if you apply it to div.prodImagesBorder, it should completely hide that element.
Upvotes: 0