title: ASP.NET UserControl with validation
body: <p>I need to create my UserControl with validation.
  I created UserControl:</p>
  
  <pre><code>&lt;%@ Control Language="C#" AutoEventWireup="true" CodeBehind="MyValidationControl.ascx.cs" Inherits="Labs.MyValidationControl" %&gt;
  
  
   &lt;asp:Label runat="server" ID="Name"&gt;Name&lt;/asp:Label&gt;     &lt;asp:TextBox ID="TextBox3" runat="server"&gt;&lt;/asp:TextBox&gt;
      &lt;asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Field ''Name'' is required." ControlToValidate="TextBox3" ValidationGroup="LoginUserValidationGroup"&gt;*&lt;/asp:RequiredFieldValidator&gt;
      &lt;br/&gt;
  
      &lt;asp:Label runat="server" ID="Password"&gt;Password&lt;/asp:Label&gt;&lt;asp:TextBox ID="TextBox2" runat="server"&gt;&lt;/asp:TextBox&gt;
      &lt;asp:RangeValidator runat="server"  MinimumValue="1" MaximumValue="10" Type="Integer" id="rngText" controltovalidate="TextBox2" ValidationGroup="LoginUserValidationGroup" errormessage="The value must be from 1 to 10!" /&gt;
      &lt;br /&gt;
  </code></pre>
  
  <p>Then I use UserControl on the form:</p>
  
  <pre><code>&lt;asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent"&gt;
  
      &lt;asp:MyValidationControl runat="server"/&gt;
  &lt;/asp:Content&gt;
  </code></pre>
  
  <p>When I start my application I see nothing on this page.</p>