title: jQuery DatePicker not working with Masterpage
body: <p>This is a follow up question from <a href="https://stackoverflow.com/questions/23785806/asp-net-with-jquery-datepicker/23786022?noredirect=1#23786022">ASP.NET with jQuery DatePicker</a></p>
  
  <p>I tried to use the jQuery UI DatePicker as suggested in this page: <a href="http://www.aspsnippets.com/Articles/jQuery-UI-DatePicker-Calendar-Example-in-ASPNet.aspx" rel="nofollow noreferrer">http://www.aspsnippets.com/Articles/jQuery-UI-DatePicker-Calendar-Example-in-ASPNet.aspx</a></p>
  
  <p>When I tested the codes in a <code>SINGLE webform</code>, it works like a charm.</p>
  
  <p>However, when I tried to incorporate them with <code>Masterpage</code> and <code>Contentpage</code>, I can't seem to make the calender working again.</p>
  
  <p>This is what I have attempted so far:</p>
  
  <p>In the <code>Masterpage</code>, I added the <code>script scr</code> and <code>link</code> in the <code>Head</code>:</p>
  
  <pre><code>&lt;head runat="server"&gt;
  &lt;meta charset="utf-8" /&gt;
  &lt;meta name="viewport" content="width=device-width, initial-scale=1.0" /&gt;
  &lt;title&gt;&lt;%: Page.Title %&gt; - My ASP.NET Application&lt;/title&gt;
  
  &lt;asp:PlaceHolder runat="server"&gt;
      &lt;%: Scripts.Render("~/bundles/modernizr") %&gt;
  &lt;/asp:PlaceHolder&gt;
  &lt;webopt:bundlereference runat="server" path="~/Content/css" /&gt;
  &lt;link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" /&gt;
  
  &lt;%--added below--%&gt;
  &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="Stylesheet" type="text/css" /&gt;
  
  &lt;/head&gt;
  </code></pre>
  
  <p>Here is part of my codes in the <code>Contentpage</code></p>
  
  <pre><code>&lt;%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Test2._Default" %&gt;
  &lt;asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server"&gt;
  &lt;script type="text/javascript"&gt;
      $(function () {
          $("[id$=txtDate]").datepicker({
              showOn: 'button',
          });
      });
  &lt;/script&gt;
  &lt;asp:TextBox ID="txtDate" runat="server" ReadOnly="true" Width="250px"&gt;&lt;/asp:TextBox&gt;
  </code></pre>
  
  <p></p>
  
  <p>What exactly have I missed?</p>