title: "Code blocks are not supported in this context" error in ASP.NET
body: <p>I am getting this error by simply trying to insert some VB.NET code in ASP.NET markup. See the code:</p>
  
  <pre><code>&lt;%@ Control Inherits="PerformanceWeb.Framework.SiteSettings" CodeBehind="sitesettings.ascx.vb" language="vb" AutoEventWireup="false" %&gt;
  
  &lt;table id="TABLE1" cellSpacing="0" cellPadding="2" border="0" runat="server"&gt;
  &lt;% If EditDowntimeMode Then%&gt;
  
      &lt;tr&gt;&lt;td class="Normal"&gt;&lt;asp:label id="lblDowntimeLegacyMode" Runat="server"&gt;lblDowntimeLegacyMode&lt;/asp:label&gt;&lt;/td&gt;&lt;/tr&gt;
  
      &lt;tr&gt;
          &lt;td class="DowntimeLegacyModeIndented" width="130"&gt;
              &lt;asp:label id="lblLegacyMode" Runat="server"&gt;lblLegacyMode&lt;/asp:label&gt;
          &lt;/td&gt;
          &lt;td class="Normal" colSpan="2"&gt;
              &lt;asp:RadioButton id="rdoLegacyMode" GroupName="DowntimeLegacyMode" Runat="server"&gt;&lt;/asp:RadioButton&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td class="DowntimeLegacyModeIndented" width="130"&gt;
              &lt;asp:label id="lblNewCauses" Runat="server"&gt;lblNewCauses&lt;/asp:label&gt;
          &lt;/td&gt;
          &lt;td class="Normal" colSpan="2"&gt;
              &lt;asp:RadioButton id="rdoNewCauses" GroupName="DowntimeLegacyMode" Runat="server"&gt;&lt;/asp:RadioButton&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
  
      &lt;tr&gt;
          &lt;td colspan="2"&gt;&lt;hr /&gt;&lt;/td&gt;
      &lt;/tr&gt;
  
  &lt;% End if%&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p><strong>Codebehind</strong></p>
  
  <pre><code>#Region "Properties"
          Public Property EditDowntimeMode() As Boolean
              Get
                  Return m_EditDowntimeMode
              End Get
              Set(ByVal value As Boolean)
                  m_EditDowntimeMode = value
              End Set
          End Property
  
  #End Region
  </code></pre>