title: Setting a WebControls TabIndex based on the ControlId of another control
body: <p>I have an ASP.NET Webforms site that is regularly having features added.
  The majority of time a new WebControl is added to the page and I need to increment the TabIndex to all subsequent controls on the page.</p>
  
  <p>I'd prefer a more robust solution than choosing an arbitrary gap between the initial assigned tab indexes. Setting the tab indexes using the designer tab order functionality is one option but I'd prefer to stay in the source view.</p>
  
  <p>Ideally, if I had, for example, three check boxes I'd like to be able to define the tabindex based off the previous controls tabindex. Then I'd only need to insert the new control and change one existing control.</p>
  
  <p>For example, add a new property TabIndexAfterControlId to WebControl:</p>
  
  <pre><code>&lt;asp:CheckBox ID="checkBoxA" runat="server" TabIndex="1"/&gt;
  &lt;asp:CheckBox ID="checkBoxB" runat="server" TabIndexAfterControlId="checkBoxA"/&gt;
  &lt;asp:CheckBox ID="checkBoxC" runat="server" TabIndexAfterControlId="checkBoxB"/&gt;
  </code></pre>
  
  <p>My first thought was to extend System.Web.UI.WebControls.WebControl with a new property, but <a href="https://stackoverflow.com/questions/619033">extension properties aren't supported</a>.</p>