title: Why <%= %> works in one situation but not in another
body: <p>This is stemming from a bad answer I gave last night.  The curiosity as to why one method works and not the other is bugging me and I'm hoping someone smarter than me can give me the proper explanation (or point me to the documentation) of why the following behavior is as it is.</p>
  
  <p>Given the following code-behind:</p>
  
  <pre><code>protected string GetMyText(string input)
  {
    return "Hello " + HttpUtility.HtmlEncode(input);
  }
  </code></pre>
  
  <p><strong>Why does this work</strong></p>
  
  <pre><code> &lt;asp:Label ID="Label1" runat="server"&gt;&lt;%= GetMyText("LabelText") %&gt;&lt;/asp:Label&gt;
  </code></pre>
  
  <p><strong>but this does not</strong></p>
  
  <pre><code>&lt;asp:Label ID="Label1" runat="server" Text='&lt;%= GetMyText("LabelText") %&gt;' /&gt;
  </code></pre>
  
  <p><strong>Edit - added</strong></p>
  
  <p>At the risk of having my original dumb answer downvoted more times, here's the link to the original question, since some of the answers I'm getting now were already covered in that question.  </p>
  
  <p><a href="https://stackoverflow.com/questions/1529944/why-cant-i-set-the-asplabel-text-property-by-calling-a-method-in-the-aspx-file/1529970#1529970">Why can&#39;t I set the asp:Label Text property by calling a method in the aspx file?</a></p>