VB.NET aspx page use codebehind variable in If statement
<p>I am trying to use codebehind variable in if statement. This is my statement.</p>

<pre><code>&lt;title&gt;&lt;%If ("&lt;%= title_tag%&gt;".ToString().Contains("MI") = True) Then%&gt;
        MI
   &lt;% Else %&gt;
        MC
    &lt;%End If %&gt;
&lt;/title&gt;
</code></pre>

<p>But If I remove the codebehind variable and just use </p>

<pre><code>&lt;title&gt;&lt;%If ("Home Care MI".ToString().Contains("MI") = True) Then%&gt;
        MI
   &lt;% Else %&gt;
        MC
    &lt;%End If %&gt;
&lt;/title&gt;
</code></pre>

<p>It works well. I've also tried escaping codebehind variable in two curly braces but it didn't help. </p>