title: How to utilize ASP.NET current user name in SqlParameter without code-behind
body: <p>How do I get to the current users name without doing it in the code-behind, just using the aspx server tags?</p>
  
  <p>In code-behind I can just do this:</p>
  
  <pre><code>Label4.Text = User.Identity.Name.ToString()
  </code></pre>
  
  <p>But I'm trying to do it without code-behind like this:</p>
  
  <pre><code>&lt;body&gt;
      &lt;form id="form1" runat="server"&gt;
      &lt;div&gt;
          1. &lt;asp:Label ID="Label1" runat="server" Text="&lt;% User.Identity.Name %&gt;"/&gt;&lt;br /&gt;
          2. &lt;asp:Label ID="Label2" runat="server" Text="&lt;%= User.Identity.Name %&gt;"/&gt;&lt;br /&gt;
          3. &lt;asp:Label ID="Label3" runat="server" Text="&lt;%# User.Identity.Name %&gt;"/&gt;&lt;br /&gt;
          4. &lt;asp:Label ID="Label4" runat="server" Text="&lt;%= Context.User.Identity.Name %&gt;"/&gt;&lt;br /&gt;
          5. &lt;asp:Label ID="Label5" runat="server" Text='&lt;%# User.Identity.Name %&gt;' /&gt;&lt;br /&gt;
          6. &lt;span runat="server" ID="Span1"&gt;&lt;%= User.Identity.Name %&gt;&lt;/span&gt;&lt;br /&gt;
          7. &lt;asp:LoginName ID="LoginName1" runat="server" /&gt;&lt;br /&gt;
          8. &lt;span&gt;&lt;%# User.Identity.Name %&gt;&lt;/span&gt;&lt;br /&gt;
          9. &lt;span&gt;&lt;%= User.Identity.Name %&gt;&lt;/span&gt;&lt;br /&gt;
          10. &lt;asp:Label ID="Label6" runat="server" Text='&lt;%= User.Identity.Name %&gt;' /&gt;&lt;br /&gt;
      &lt;/div&gt;
      &lt;/form&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>I get the username displayed for lines 6, 7, and 9 but I really want to set a property of a control to this value and not just display it on screen.</p>
  
  <p>Is it possible?</p>
  
  <p>Background: I was whipping up a quick app, dragging and dropping controls on the page, and it turned out that I did it with only having 1 line in code-behind of the page(s). That line was setting the value of a hidden field to the current users name in page load so I could pass the value of that control as a param of a sqlparameter. So I thought that since I was going this route (lots of stuff in aspx that maybe shouldn't be there) I should try to be consistent with it. I don't normally do it this way, but wanted to this time</p>