title: Date format in textbox [ASP.NET]
body: <p>I have a grid which gets populate with data from my database. As part of my grid I have a view button which views the records in a modal form.</p>
  
  <p>One of my records has a date. When the textbox in the modal form gets populated with the date it gets displayed like this: "2018/01/25 12:00:00 AM"</p>
  
  <p>I want only the date to be displayed without the time. I have made sure that inside my SQL table that it is only date being saved and it is.</p>
  
  <p>This is the column in my grid:</p>
  
  <pre><code> &lt;asp:BoundField DataField="Date" HeaderText="Date" DataFormatString="{0:dd/MMM/yyyy}" SortExpression="Date"/&gt;
  </code></pre>
  
  <p>This is my textbox:</p>
  
  <pre><code> &lt;asp:TextBox ID="txtDate" runat="server" placeholder="Date" class="form-control"&gt;&lt;/asp:TextBox&gt;
  </code></pre>
  
  <p>I have tried the following but it does not work:</p>
  
  <pre><code>txtDate.Text = Y.Date.ToShortDateString();
  Text='&lt;%#((DateTime)Bind("NewDate")).ToString("dd/MM/yyyy")%&gt;'
  Text='&lt;%# Bind("JoinDate", "{0:MM-dd-yyyy}") %&gt;' 
  </code></pre>
  
  <p>I tried writing javascript code and limit the characters but the time still shows on load.</p>
  
  <p>I would like only the date to be shown in my textbox.</p>
  
  <p>Please advise. Thanks</p>