ASP.net set value to hidden form control
<p>In the ASP.net, I try to set a variable value to hidden field, but I get exception. </p>

<p>In the first output, it is correct. then I put it into hidden field, failed.</p>

<p>How to fix it ?</p>

<pre><code> user name: &lt;%= User.Identity.Name %&gt; // output is correct
    &lt;form runat=Server&gt;
    &lt;asp:HiddenField id="HiddenField1" value=&lt;%= User.Identity.Name %&gt; runat=Server /&gt;
    &lt;/form&gt;
</code></pre>

<p>error</p>

<pre><code>Parser Error 
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. 

Parser Error Message: Server tags cannot contain &lt;% ... %&gt; constructs.
</code></pre>
