Using variables in Asp.NET Control Attributes in Html View
<p>I wonder if there is any way to do this:</p>

<pre><code>&lt;asp:Label ID="lblSomething" runat="server" Visible="this.ShowLabel"/&gt;
</code></pre>

<p>and in the code behind:</p>

<pre><code>public bool ShowLabel {get;set;}
</code></pre>

<p>I know some of you may ask me why I need it but I find this approach cleaner than saying this in the code behind:</p>

<pre><code>lblSomething.Visible = this.ShowLabel
</code></pre>

<p>And also I could say this in source view:</p>

<pre><code>&lt;% if(this.ShowLabel){ %&gt;
   &lt;asp:Label ID="lblSomething" runat="server" Text="Something"/&gt;
&lt;% } %&gt;
</code></pre>

<p>but again, the first one would be more intuitive to me. Any ideas?</p>
