DatePicker inside asp.net gridview not displaying?
<p>I've got an asp.net gridview inside an updatepanel.
One of the fields I have on there is a simple textbox like so:</p>

<p><code>&lt;asp:TextBox ID="txtDueDate" Text='&lt;%# Eval("DueDate") %&gt;' Width="75px" runat="server" ToolTip="Select the due date." CssClass="datePickerDueDate"&gt;&lt;/asp:TextBox&gt;</code></p>

<p>I want the jquery ui datepicker to appear when I click on this text box, I tried:</p>

<pre><code>  $(".datePickerDueDate").datepicker({
            });
</code></pre>

<p>In chrome developer tools this textbox's id appears as: <code>id="MainContent_gvLineItems_txtDueDate_0"</code>
What is the best way to handle this?  My current issue is the calendar does not appear UNLESS I open developer tools and enter it directly in the console window and hit enter.</p>

<h2>Edit</h2>

<p>I can solve it with this:</p>

<p><code>ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "setDueDate", "$(function(){$('.datePickerDueDate').datepicker('option' 'firstDay', 1);});", true);</code></p>

<p>In code behind but this appears to be ugly...is there a better way?</p>
