title: JQuery in ASP.NET - Form Validation Issue
body: <p>It's not working at all and I'm not sure why. Ideally I'd like to have all the errors pop up in a modal dialog box. But right now I can't even get it to work normally. Any help would be appreciated. Thanks.</p>
  
  <p>HTML</p>
  
  <pre><code>&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head runat="server"&gt;
  &lt;title&gt;&lt;/title&gt;
  &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="http://ajax.microsoft.com/ajax/jquery.validate/1.7/jquery.validate.min.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="../Scripts/Frame.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body runat="server" id="bodyLogin"&gt;
  &lt;div runat="server" id="frameLogin"&gt;
      &lt;form runat="server" id="formLogin"&gt;
          &lt;asp:CheckBox runat="server" ID="checkboxRemember" /&gt;
          &lt;div&gt;&lt;span id="un"&gt;Username&lt;/span&gt;&lt;div id="forgotUsername"&gt;?&lt;/div&gt;&lt;br /&gt;
          &lt;asp:TextBox runat="server" ID="textUsername" Name="username" /&gt;&lt;/div&gt;
          &lt;div&gt;&lt;span id="pw"&gt;Password&lt;/span&gt;&lt;div id="forgotPassword"&gt;?&lt;/div&gt;&lt;br /&gt;
          &lt;asp:TextBox runat="server" ID="textPassword" Name="password" TextMode="Password" /&gt;&lt;/div&gt;
          &lt;asp:Button runat="server" ID="buttonLogin" Text="L" /&gt;
          &lt;asp:Button runat="server" ID="buttonRegister" Text="R" /&gt;
      &lt;/form&gt;
  &lt;/div&gt;
  &lt;div id="dialog" title="Errors" style="display:none;"&gt;&lt;ul&gt;&lt;/ul&gt;&lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>JQuery</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  $(function () {
  $("#formLogin").validate({
      rules: {
          username: {
              required:true,
              minlength:3,
              maxlength:15
          },
          password: {
              required:true,
              minlength:6,
              maxlength:15
          },
      },
      messages: {
          username: {
              required: "Username is required.",
              minlength: "Username minimum length is 3 characters.",
              maxlength: "Username maxumum length is 15 characters."
          },
          password: {
              required: "Password is required.",
              minlength: "Password minumum length is 6 characters.",
              maxlength: "Password maximum length is 15 characters."
          }
      }
  });
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>EDIT: I tried both...</p>
  
  <pre><code>&lt;%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Frame_Login.aspx.cs" Inherits="Website.Frames.Frame_Login" ClientIDMode="Static" %&gt;
  </code></pre>
  
  <p>and...</p>
  
  <pre><code>    $("#&lt;%= formLogin.ClientID %&gt;").validate({
  </code></pre>