title: Behaviour of System.Web.UI.WebControls.Unit
body: <p>I have a <code>asp:TextBox</code> and I can set the <code>width</code> the following way:</p>
  
  <pre><code>&lt;asp:TextBox runat="server" ID="TextBox1" Width="100"&gt;&lt;/asp:TextBox&gt;
  </code></pre>
  
  <p><strong>or</strong></p>
  
  <pre><code>&lt;asp:TextBox runat="server" ID="TextBox1" Width="100%"&gt;&lt;/asp:TextBox&gt;
  </code></pre>
  
  <p>In Codebehind I can only set</p>
  
  <pre><code>TextBox1.Width = 100; // remember, Width is type of Unit, not int
  </code></pre>
  
  <p><strong>Not</strong> possible is this:</p>
  
  <pre><code>TextBox1.Width = "100%"; 
  </code></pre>
  
  <p>What I expect</p>
  
  <pre><code>TextBox1.Width = new Unit.. ;
  </code></pre>
  
  <p>Question: Why does <code>nUnit</code> behave this way? Why is <code>int</code> possible but <code>string</code> not and why is not a new object of <code>Unit</code> expected?</p>