title: jQuery not working with Master Page
body: <p>I have some piece of code that was working individually but when I add it with the Master page, it is not working.
  I thought jQuery doesn't work with Update Panel, so I removed that as well, but still no use. I believe it is some problem with Master Page.
  Can anyone have a look and give any advice.</p>
  
  <pre><code>&lt;%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master"AutoEventWireup="true"
  CodeBehind="Default.aspx.cs" Inherits="AdhocTest._Default" %&gt;
  
  &lt;asp:Content ID="HeaderContent" runat="server"     ContentPlaceHolderID="ContentPlaceHolder2"&gt;&lt;b&gt;Adhoc ArchivingTest  Page&lt;/b&gt;
  &lt;/asp:Content&gt;
  &lt;asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="ContentPlaceHolder1"&gt;
  
  
  &lt;script  src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
      $(document).ready(function () {
  
          alert(2);
          function isDate(txtDate) {
              var currVal = txtDate;
              if (currVal == '')
                  return false;
  
              //Declare Regex 
              //  var rxDatePattern = /^(\d{1,2})(\/|-)(\d{1,2})(\/|-)(\d{4})$/;
              var rxDatePattern = /^(\d{4})(\d{1,2})(\d{1,2})(\d{1,2})(\d{1,2})(\d{1,2})$/
              var dtArray = currVal.match(rxDatePattern); // is format OK?
  
              if (dtArray == null)
                  return false;
  
              //Checks for mm/dd/yyyy format.
              //    dtMonth = dtArray[1];
              //   dtDay = dtArray[3];
              //   dtYear = dtArray[5];
  
  
              dtMonth = dtArray[2];
              dtDay = dtArray[3];
              dtYear = dtArray[1];
              ddhours = dtArray[4];
              ddminute = dtArray[5];
              ddseconds = dtArray[6];
  
              if (ddhours &gt; 24)
                  return false;
              if (ddminute &gt; 60)
                  return false;
              if (ddseconds &gt; 60)
                  return false;
  
              if (dtMonth &lt; 1 || dtMonth &gt; 12)
                  return false;
              else if (dtDay &lt; 1 || dtDay &gt; 31)
                  return false;
  
              else if ((dtMonth == 4 || dtMonth == 6 || dtMonth == 9 || dtMonth == 11) &amp;&amp; dtDay == 31)
                  return false;
              else if (dtMonth == 2) {
                  var isleap = (dtYear % 4 == 0 &amp;&amp; (dtYear % 100 != 0 || dtYear % 400 == 0));
                  if (dtDay &gt; 29 || (dtDay == 29 &amp;&amp; !isleap))
                      return false;
              }
              return true;
          }
  
          $(function () {
  
  
  
              $('#txtname').blur(function (e) {
                  alert(1);
                  //     var GetValue = $('#txtname').val();
  
  
                  var txtVal = $('#txtname').val();
  
                  if (isDate(txtVal))
  
                      alert('Valid Date format');
  
                  else
  
                      alert('Invalid Date format');
              });
          });
  
      });
  
  
  &lt;/script&gt;
  
  
  &lt;%--
  &lt;form id="form1" runat="server"&gt;--%&gt;
      &lt;div&gt;
      &lt;asp:Table ID="tblAdhocReq" runat="server" BackColor="White" 
              BorderColor="#999999" BorderStyle="None" BorderWidth="1px" cellpadding="3" 
              cellspacing="5" CssClass="contentheadlinemed" Font-Size="Smaller" 
              GridLines="Both" visible="true"&gt;
              &lt;asp:TableRow&gt;
         &lt;asp:TableCell BackColor="#E0E0E0" HorizontalAlign="Right"&gt;ENTER REPORT VERSION DATE: : &lt;/asp:TableCell&gt;&lt;asp:TableCell&gt;
             &lt;asp:TextBox ID="txtname"  runat="server" /&gt;
              &amp;nbsp&amp;nbsp&lt;i&gt;(Must enter in format YYYYMMDDHHMMSS)&lt;/i&gt;  
  
          &lt;/asp:TableCell&gt;&lt;asp:TableCell  BorderWidth="0"&gt;&lt;asp:Label ID="Label2"  runat="server" Font-Italic="true" 
              Visible="false" ForeColor="red"/&gt;&lt;/asp:TableCell&gt;&lt;/asp:TableRow&gt;&lt;/asp:Table&gt;&lt;%-- &lt;asp:TextBox runat="server" ID="txtname"&gt;&lt;/asp:TextBox&gt;
  
           &lt;asp:TextBox runat="server" ID="TextBox1"&gt;&lt;/asp:TextBox&gt;--%&gt;&lt;/div&gt;&lt;%--&lt;/form&gt;--%&gt;&lt;%--&lt;/ContentTemplate&gt;--%&gt;&lt;%--&lt;/asp:UpdatePanel&gt;--%&gt;&lt;asp:Label id="ADDMsg" ForeColor="Red"  Runat="Server" Font-Bold="true"/&gt;
  &lt;br /&gt;  
  </code></pre>
  
  <p></p>