title: Is it possible to put html element in aspx if funtion?
body: <p>Could it possible to put element in if function in ASP.NET like in ASP.NET MVC Razor view?
  Maybe something like this :</p>
  
  <pre><code>&lt;% if (Visible)
     {
         &lt;div&gt;I want to determine here&lt;/div&gt;
     } %&gt;
  </code></pre>
  
  <p>But this will show error... I knew it could solve by using javascript or div with codebehind:</p>
  
  <pre><code>&lt;div style="&lt;%=isNotGame? "display:none":"display:block" %&gt;"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>or:</p>
  
  <pre><code>&lt;div runat="server" id="codeBehind"&gt;&lt;/div&gt;
  CodeBehind.InnerHTML="...";
  </code></pre>
  
  <p>Q1: Is it possible? If yes, how?</p>
  
  <p>Q2: Why I want to do this is because I think if I don't want to show an element, it is better not to create the element than create and hide it, is it correct?</p>