Aspx code blocks vs runat server
<p>I am learning some aspx and had a question. I have the following example code:</p>

<pre><code>&lt;%@ Page Language="C#" %&gt;
&lt;html&gt;
&lt;body&gt;
    &lt;form id="form1" runat="server"&gt;
       Current server time is &lt;% =GetTime()%&gt;.
    &lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>Now what i dont understand here is that if the form is running at server already, why do we need the &lt;% %> code blocks again? Maybe im not understanding the distinction between the code blocks and the whole running at server on the page. Can anyone please clear up my misconceptions about what is happening here? I just dont really understand the serverside vs clientside terminology for an aspx page.</p>

<p>I have also seen code like this:</p>

<pre><code>&lt;script language="VB" runat="server"&gt;
Dim ....

Public Sub PageLoad()
...
Response.Write("Hello")
End Sub
&lt;/script&gt;

&lt;% If dataExists(whatever) Then %&gt;
HelloWorld
</code></pre>

<p>Now why couldnt the codeblocks be eliminated above? I mean in the server tags, that code is already running server side and making some write requests. Then you have code blocks which are doing some logic check to write again. Why separate these? Arent they the same functionality or am i missing something?</p>
