title: jquery datepicker date not binding to asp.net textbox in gridview editing/updating (with masterpage)
body: <p>in the code below, the string <strong><em>sFoodFormReceived1</em></strong> always gets the value of DateTime.Now.  I dont know how to make the date clicked on the datepicker UI bind to the textbox in the gridview gvReservationsWithForms.</p>
  
  <pre><code>protected void gvReservationsWithForms_RowUpdating(object sender, GridViewUpdateEventArgs e)
  {
      GridViewRow row = gvReservationsWithForms.Rows[e.RowIndex];
      string sFoodFormReceived1 = ((TextBox)(row.Cells[9].Controls[1])).Text;
  
      DataTable dt = dsReservationsToBind.Tables[0];
  
  
      dt.Rows[gvReservationsWithForms.EditIndex]["FoodFormReceived"] = new DateTime(System.DateTime.Parse(sFoodFormReceived1));
      DataRow dr = dt.Rows[row.DataItemIndex];
  
      var Reservation = new reservation_RoomReservationTableAdapter();
  
      Reservation.Update(dr);
  
      gvReservationsWithForms.EditIndex = -1; 
      gvReservationsWithForms.DataBind();        
  
  }
  
  
  &lt;asp:Content ID="Content4" ContentPlaceHolderID="Main" Runat="Server"&gt;
  &lt;script type="text/javascript"&gt; 
       $(document).ready(function () 
         {$("input[id$='tbFoodFormReceivedEditItemTemplate']").datepicker();})
  &lt;/script&gt;  
     &lt;asp:GridView ID="gvReservationsWithForms" runat="server"     
      AutoGenerateColumns="False" 
      DataKeyNames="RoomReservationID" AutoGenerateSelectButton="True" 
      allowsorting ="True" AutoGenerateEditButton="True" BackColor="White" 
      BorderColor="#999999" BorderStyle="None" BorderWidth="1px" CellPadding="3" 
      GridLines="Vertical" onsorting="gvReservationsWithForms_Sorting1" 
      onrowcancelingedit="gvReservationsWithForms_RowCancelingEdit" 
      onrowediting="gvReservationsWithForms_RowEditing" 
      onrowupdating="gvReservationsWithForms_RowUpdating" 
      onselectedindexchanged="gvReservationsWithForms_SelectedIndexChanged1" 
      onrowupdated="gvReservationsWithForms_RowUpdated"&gt;
      &lt;RowStyle BackColor="#EEEEEE" ForeColor="Black" /&gt;
  &lt;columns&gt;
        &lt;asp:BoundField DataField="RoomReservationID" HeaderText="Confirmation ID" SortExpression="RoomReservationID" Visible="false" /&gt;
        &lt;asp:BoundField DataField="Room" HeaderText="Room" SortExpression="Room" ReadOnly="true"/&gt;    
         &lt;asp:BoundField DataField="BeginDate" HeaderText="Event Begin Date" SortExpression="BeginDate" ReadOnly="true"/&gt;  
        &lt;asp:BoundField DataField="EndDate" HeaderText="Event End Date" SortExpression="EndDate" ReadOnly="true"/&gt; 
        &lt;asp:BoundField DataField="BeginTime" HeaderText="Event Begin Time" SortExpression="BeginTime" ReadOnly="true"/&gt; 
        &lt;asp:BoundField DataField="EndTime" HeaderText="Event End Time" SortExpression="EndTime" ReadOnly="true"/&gt; 
        &lt;asp:BoundField DataField="Department" HeaderText="Department/Organization" SortExpression="Department" ReadOnly="true"/&gt;      
        &lt;asp:BoundField DataField="Activity" HeaderText="Activity"  SortExpression="Activity" ReadOnly="true"/&gt;    
         &lt;asp:TemplateField HeaderText="Food Form Received" 
            SortExpression="FoodFormReceived"&gt;
             &lt;EditItemTemplate&gt;
                 &lt;asp:TextBox ID="tbFoodFormReceivedEditItemTemplate" runat="server"  CssClass="datepickers"
                     Text='&lt;%# DateTime.Now%&gt;'&gt;  &lt;/asp:TextBox&gt;
             &lt;/EditItemTemplate&gt;
             &lt;ItemTemplate&gt;
                 &lt;asp:Label ID="Label1" runat="server" Text='&lt;%# Bind("FoodFormReceived") %&gt;'&gt;&lt;/asp:Label&gt;
             &lt;/ItemTemplate&gt;
        &lt;/asp:TemplateField&gt;
        &lt;/columns&gt;
      &lt;FooterStyle BackColor="#CCCCCC" ForeColor="Black" /&gt;
      &lt;PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" /&gt;
      &lt;SelectedRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" /&gt;
      &lt;HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White" /&gt;
      &lt;AlternatingRowStyle BackColor="#DCDCDC" /&gt;
  &lt;/asp:GridView&gt;
  &lt;/asp:Content&gt;
  </code></pre>