title: Integer Drop Down List for ASP.NET Webforms
body: <p>I have a Web forms project with a model class:</p>
  
  <pre><code>public class PayrollPeriod
      {
          [ScaffoldColumn(false)]
          [Key]
          public int PayrollPeriodId { get; set; }
  
          [ScaffoldColumn(false)]
          [Required]
          public string UserId { get; set; }
          public virtual ApplicationUser User { get; set; }
  
          [Range(1, 24, ErrorMessage = "Value for {0} must be between {1} and {2}.")]
          [Required, Display(Name = "Working Hours In A Day")]
          public int HrsInDay { get; set; }
  
          //...
       }
  </code></pre>
  
  <p>The scaffolding generates the following Insert.aspx:</p>
  
  <pre><code> &lt;asp:FormView runat="server"
              ItemType="PayMaster.Models.PayrollPeriod" DefaultMode="Insert"
              InsertItemPosition="FirstItem" InsertMethod="InsertItem"
              OnItemCommand="ItemCommand" RenderOuterTable="false"&gt;
              &lt;InsertItemTemplate&gt;
                  &lt;fieldset class="form-horizontal"&gt;
                      &lt;legend&gt;Insert Payroll Period&lt;/legend&gt;
                      &lt;asp:ValidationSummary runat="server" CssClass="alert alert-danger" /&gt;
                      &lt;asp:DynamicControl Mode="Insert" DataField="StartDate" runat="server" /&gt;
                      &lt;asp:DynamicControl Mode="Insert" DataField="EndDate" runat="server" /&gt;
                      &lt;asp:DynamicControl Mode="Insert" DataField="HrsInDay" runat="server" /&gt;
                      &lt;asp:DynamicControl Mode="Insert" DataField="DaysInWeek" runat="server" /&gt;
  </code></pre>
  
  <p>I am not very familiar with ASP Web Forms. How do I edit the dynamic control for <code>HrsInDay</code> to show a drop down list with the intergers 1 - 24?</p>