title: What can be used in place of dynamic id for form to use in jQuery validation?
body: <p>I have an aspx content page and this inherit by master page.</p>
  
  <p>In master page my main content place holder comes under a <code>&lt;form&gt;</code>,</p>
  
  <pre><code>&lt;form runat="server"&gt;
  &lt;div class="page"&gt;
  
      &lt;div class="main"&gt;
          &lt;asp:ContentPlaceHolder ID="MainContent" runat="server"/&gt;
      &lt;/div&gt;
      &lt;div class="clear"&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="footer"&gt;
  
  &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Below is code for my content page:</p>
  
  <pre><code>&lt;asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent"&gt;
  &lt;table border="0" cellpadding="3" cellspacing="3"&gt;
      &lt;tr&gt;
          &lt;td colspan="2" class="header" style="color: Black;"&gt;
              LOGIN USER
          &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td align="right"&gt;
              &lt;asp:Label ID="lblUserName" runat="server" Text="UserName: "&gt;&lt;/asp:Label&gt;
          &lt;/td&gt;
          &lt;td align="left"&gt;
              &lt;asp:TextBox ID="txtUserName" runat="server"&gt;&lt;/asp:TextBox&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td align="right"&gt;
              &lt;asp:Label ID="lblPassword" runat="server" Text="Password: "&gt;&lt;/asp:Label&gt;
          &lt;/td&gt;
          &lt;td align="left"&gt;
              &lt;asp:TextBox ID="txtPassword" runat="server" TextMode="Password"&gt;&lt;/asp:TextBox&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td align="center" colspan="2"&gt;
              &lt;asp:Button ID="btnSubmit" runat="server" Text="Submit" /&gt;&amp;nbsp;
              &lt;asp:Button ID="btnReset" runat="server" Text="Reset" /&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;
  &lt;div align="center" class="alertmsg"&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p></p>
  
  <p>While I going to use jQuery validation plugin:</p>
  
  <pre><code>&lt;script type="text/javascript" language="javascript"&gt;
      $(document).ready(function () {
              $('#ctl01').validate({
              rules: {
                      &lt;%=txtUserName.UniqueID %&gt;: {
                          minlength: 2,
                          required: true
                      },
                       &lt;%=txtPassword.UniqueID %&gt;: {                        
                          required: true,
                          email:true
                      }
                  },
              messages: {
                      &lt;%=txtUserName.UniqueID %&gt;:{  
                          required: "* Required Field *",  
                          minlength: "* Please enter atleast 2 characters *"  
                      },
                      &lt;%=txtPassword.UniqueID %&gt;:{  
                          required: "* Required Field *",  
                          email: "* Please enter valid email address *"  
                      }       
                  }
  
          });
  });
  
  &lt;/script&gt;
  </code></pre>
  
  <p>The dynamic id of <code>txtUserName</code> can be exposed by <code>&lt;%=txtUserName.UniqueID %&gt;</code>, but why do I need to give the id of the form to <code>$('#ctl01').validate</code>?
  Can I use any other id in place of <code>#ctl01</code>?</p>