I've got a part of my application which deals with tracking the dates a particular item is worked on. It is a single aspnet page, which displays controls to either start or stop tracking, depending on the state of the work item.There are up to three controls on the page. A calendar to enter the date that work was stopped/started. A dropdown to select a reason the work item was stopped. A text area to enter a comment.Because a similar set of controls will be created on both possible work item states (either started or stopped), I've decided to create a single set of controls, and modify them depending on the state of the work item.The markup I use for the controls is below:<div id=DatePickerContainer>    <span id=DatePickerLabel runat=server></span>    <asp:Calendar id=DatePickerControl runat=server></asp:Calendar></div><div id=DropdownContainer runat=server>    <span id=DropdownLabel runat=server></span>    <asp:DropDownList id=DropdownControl runat=server></asp:DropDownList></div><div id=TextReasonContainer>    <span id=TextReasonLabel runat=server></span>    <textarea id=TextReasonControl></textarea></div>And the code behind to initialise:  void Page_Load(Object sender, EventArgs e){    if (this.WorkItemIsStopped())    {        this.SetupStartControls();    }     else     {        this.SetupStopControls();    }}void SetupStartControls(){    this.DatePickerLabel.InnerText = Start date;    this.DropdownContainer.Visible = false;    this.TextReasonLabel.InnerText = Start comment;}void SetupStopControls(){    this.DatePickerLabel.InnerText = Stop date;    this.DropdownLabel.InnerText = Stop Reason;    this.DropdownControl.DataSource = this.CreateDropdownDataSource();    this.TextReasonLabel.InnerText = Stop comment;}Is this a reasonable approach? The alternative would be to create two similar but separate sets of controls in the markup, and simply hide the set which are not relevant to the current state of the work item.
Creating controls on a page which differ slightly depending on an external state
c#;asp.net