title: JQuery DatePicker Working Intermittently
body: <p>I am using the <strong>JQuery DatePicker</strong> plugin for my ASP.Net MVC 3 Web Application. I have used the DatePicker alot of times previously in other applications without any trouble.</p>
  
  <p>However, I have come across an issue in my current app, whereby, the JQuery DatePicker works only intermittently. What I mean by this is, for example, I have the following JavaScript file</p>
  
  <pre><code>$(document).ready(function () {
  
      //Equal Opps
      $('#DOB').datepicker({ dateFormat: 'dd/mm/yy', changeMonth: true, changeYear: true, yearRange: "1900:2030" });
  
  
  });
  </code></pre>
  
  <p>This file is referenced in my Razor View (along with all the other files needed to make DatePicker work) and then I have the following TextBox which once clicked on, the DatePicker should pop up.</p>
  
  <pre><code>&lt;div class="editor-field sepH_b"&gt;
              @Html.TextBoxFor(model =&gt; model.DOB)
              @Html.ValidationMessageFor(model =&gt; model.DOB)
  &lt;/div&gt;
  </code></pre>
  
  <p>However, sometimes when the page loads and I click on the TextBox, the DatePicker pops up, if I refresh the page and click on the TextBox again, the DatePicker won't work, if I then refresh again and click on the TextBox, the DatePicker then works ???</p>
  
  <p>Sometimes when I load the page for the 1st time, the DatePicker will not work at all.</p>
  
  <p>I really have no solution to what is going on here. Maybe it is a caching issue, but I really don't know.</p>
  
  <p>Please could someone help me with this, it would be greatly appreciated.</p>
  
  <p>Thank you.</p>