title: When should EnableViewState be enabled on a server control?
body: <p>Is there any guideline or rule for when the <strong>view state</strong> should be enabled on a server control? And when it should <strong><em>not</em></strong>?</p>
  
  <p>I was looking at this <a href="http://quickstarts.asp.net/QuickStartv20/util/srcview.aspx?path=~/aspnet/samples/data/GridViewMasterDetailsInsert.src" rel="noreferrer"><code>SqlDatasource</code> example</a> and noticed that the view state for the label control is not enabled:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;asp:Label ID="ErrorMessageLabel" EnableViewState="false" runat="server" /&gt;
  </code></pre>
  
  <p>Why isn't <code>EnableViewState</code> enabled on the label control? I know that enabling the view state carries some overhead so I would like to use it only when it is needed.</p>