0
我有一個placholder,我不只是想使用Visible =「false」,因爲它保留了頁面上的一些空間。我不希望預留空間。我怎樣才能做到這一點?也許使用一些事情?display:none;在佔位符上?
<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>
代碼隱藏:
if(ImageTabel.Rows[i]["ImgUrl"].ToString() != lblOldImgUrl.Text)
{
PlaceHolder phImage = (PlaceHolder)ImageList.Items[i].FindControl("phImage");
phImage.Visible=true;
}
你有沒有試過把你的服飾佔位符放在'if'裏面? – 2012-03-31 15:43:37