Simple HTML construction in ASP.NET?
<p>A simple question, I think:</p>

<p>I want to put a tag into an ASP.NET app I've been asked to maintain, so I'm coming at this from a newbie point of view just tinkering around the edges without knowing a lot.</p>

<p>I wrote an old ASP application back in 1998, so I am just running on memory...</p>

<p>How do I write some output to the webpage?</p>

<p>I know I can use an </p>

<pre><code>&lt;asp:label id="blah"&gt;
</code></pre>

<p>but then I need to define a Label blah; in my code behind and then assign it.</p>

<p>I believe that I can put in-place:</p>

<pre><code>&lt;% Response.Write("sometext"); %&gt;
</code></pre>

<p>and that will write sometext in the location within the page.  (Am I correct?)</p>

<p>Lastly, I remember there was a syntax to the effect of</p>

<pre><code>&lt;%= "some string" %&gt;
</code></pre>

<p>but I can't find the documentation on it, to say either it is deprecated, unadvised, or the rationale for such a decision.</p>

<p>I have tried googling for "ASP.NET grammar" but I can't even find a good description that "&lt;%=" even exists, though it is mentioned in a few blogs.</p>

<p>For something simple, like inject the global version number, or the current date, then I can't see anything particularly wrong with in-place composition - it would save me defining 15 labels and having to initialise them all - though perhaps the asp:label approach could reference one global instance of a label?</p>

<p>Just asking for opinions on good practices :)</p>
