I have a hyperlink in a usercontrol that I’d like to set visibility by using a declarative property, i.e.
<asp:HyperLink ImageUrl="/images/icons/rss.png" Visible="<%# ShowRssIcon %>" ID="FeedHyperLink" runat="server"></asp:HyperLink>
However, it always remains visible, even if ShowRssIcon is false. ShowRssIcon is a simple property set on the usercontrol. Even setting ShowRssIcon to always return false results in the hyperlink showing.
However, setting Visible="false" or Visible="true" manually works as expected. Also, setting the property in the code behind on Page_Load event also works.
Any ideas? Thanks.
Since
<%# expressionsare evaluated atDataBind()time, if you used that, then you need to callDataBind();method at PreRenderComplete like..