Listing 1: The code-behind file for the user control
<%@ Control Language="c#" AutoEventWireup="false" Codebehind="DateRangeUserControl.ascx.cs"
Inherits="TestCtrls.DateRangeUserControl" TargetSchema="http://schemas.microsoft.com/intellisense/ie5"%>
<table border="0" cellspacing="2" cellpadding="2">
<tr>
<td>Begin Date:</td>
<td><asp:TextBox ID="beginDateTxtBox" Runat="server" /></td>
<td><asp:RequiredFieldValidator ID="beginDateTxtBoxReqFieldVal" Runat="server" ControlToValidate="beginDateTxtBox"
Font-Size="8pt" Display="Dynamic" ErrorMessage="Required Field" /></td>
</tr>
<tr>
<td>End Date:</td>
<td><asp:TextBox ID="endDateTxtBox" Runat="server" /></td>
<td><asp:RequiredFieldValidator ID="endDateTxtBoxReqFieldVal" Runat="server" ControlToValidate="endDateTxtBox"
Font-Size="8pt" Display="Dynamic" ErrorMessage="Required Field" /></td>
</tr>
</table>