title: How will calculate date difference in days in asp
body: <p>I need date difference in days. I used TimeSpan to calculate difference.but it shows difference only in hours. I want to display in days into my textbox. whats wrong in my code. </p>
  
  <p>My code is here:</p>
  
  <pre><code>protected void txtDate1_TextChanged(object sender, EventArgs e)
  {
      startdate = DateTime.Parse(txtDate.Text).Date;
      enddate = DateTime.Parse(txtDate1.Text).Date;
      remaindate = (enddate - startdate);
      txtdays.Text = remaindate.TotalDays.ToString();
  }
  </code></pre>