title: <asp:TextBox> must hide time, only show date
body: <p>I have a <code>&lt;asp:TextBox&gt;</code> that I made as hidden with a date value from a SQL table.</p>
  
  <blockquote>
    <p>Expected: 05/23/2017</p>
    
    <p>Result: 05/23/2017 12:00:00 AM</p>
  </blockquote>
  
  <p>Below are my codes for the <code>TextBox</code> and the binding:</p>
  
  <pre><code>&lt;asp:TextBox ID="txtDateOrdered" runat="server" class="form-control" ReadOnly="true" /&gt;
  </code></pre>
  
  <hr>
  
  <pre><code>void GetOrderHead(int ID)
      {
          con.Open();
          SqlCommand cmd = new SqlCommand();
          cmd.Connection = con;
          cmd.CommandText = "SELECT * FROM Orders WHERE OrderNo=@OrderNo";
          cmd.Parameters.AddWithValue("@OrderNo", ID);
          SqlDataReader dr = cmd.ExecuteReader();
          if (dr.HasRows)
          {
              while (dr.Read())
              {
                  ltID.Text = dr["OrderNo"].ToString();
                  txtOrderNo.Text = dr["OrderNo"].ToString();
                  txtDateOrdered.Text = dr["DateOrdered"].ToString();
                  txtPreparedBy.Text = dr["PreparedBy"].ToString();
                  txtStatus.Text = dr["Status"].ToString();
                  txtBalance.Text = dr["Balance"].ToString();
                  txtTotal.Text = dr["TotalAmount"].ToString();
              }
              con.Close();
          }
          else
          {
              con.Close();
              Response.Redirect("Default.aspx");
          }
      }
  </code></pre>
  
  <hr>
  
  <p>Note: I found a answer for this by using <code>.ToString("MM/dd/yyyy");</code> &amp; <code>.ToShortDateString();</code> and both didn't work.</p>