<asp:Repeater> 让我发疯
我需要去做
<ItemTemplate>
<% if (Container.DataItem("property") == "test") {%>
I show this HTML
<% } else { %>
I show this other HTML
<% } %>
</ItemTemplate>
Run Code Online (Sandbox Code Playgroud)
但我无法为我的生活找到任何方法来实现这一目标.三元不是很好,因为HTML的数量非常大,通过DataBind事件设置标签也不是很好,因为我必须在代码隐藏中拥有大块的HTML.
当然有办法做到这一点....