Web developers wiki ASP.NET Sitecore Sharepoint Kentico by Evident Interactive

Hide markup when evaluated variable is empty

Modified: 2011/06/17 13:08 by jim - Categorized as: ASP.NET, HTML, Kentico
Sometimes you get a part of your usercontrol markup that only needs to be rendered when some variable contains something. In this case Title. We whipped up this beauty to hide content without going to the backend.

<asp:Placeholder runat="server" visible='<%# Eval<string>(" Title ") != "" %>'>
<h3><%# Eval(“Title”) %></h3>

If you want to hide content that is rendered by asp:controls, I would like to refer to this blog: enclosure

 © Evident Interactive BV