Here I have created sample that takes range of date and give days count of provided Date Range.
I hope this will help you out.
HTML
<div>
<cc1:ToolkitScriptManager runat="server">
</cc1:ToolkitScriptManager>
<table>
<tr>
<td>
<asp:Label Text="Enter Start Date" runat="server" />
</td>
<td>
<asp:TextBox ID="txtStartDate" runat="server" />
<cc1:CalendarExtender ID="ceStartDate" runat="server" TargetControlID="txtStartDate"
PopupPosition="Right" Format="dd/MM/yyyy" />
</td>
</tr>
<tr>
<td>
<asp:Label Text="Enter End Date" runat="server" />
</td>
<td>
<asp:TextBox ID="txtEndDate" runat="server" />
<cc1:CalendarExtender ID="ceEndDate" runat="server" TargetControlID="txtEndDate"
PopupPosition="Right" Format="dd/MM/yyyy" />
</td>
</tr>
<tr style="text-align: center">
<td colspan="2">
<asp:Button ID="btnGetDays" runat="server" Text="Get Days" OnClick="CalculateDays" />
</td>
</tr>
<tr>
<td colspan="2">
<asp:Label ID="lblDays" runat="server" />
</td>
</tr>
</table>
</div>
Namespaces
using System;
using System.Globalization;
Code
protected void CalculateDays(object sender, EventArgs e)
{
this.CalculateDays();
}
private void CalculateDays()
{
TimeSpan i = new TimeSpan(0, 0, 0);
DateTime startDate = Convert.ToDateTime(this.txtStartDate.Text.Trim(), new CultureInfo("en-Gb"));
DateTime endDate = Convert.ToDateTime(this.txtEndDate.Text.Trim(), new CultureInfo("en-Gb"));
i += endDate.Subtract(startDate);
int days = i.Days;
this.lblDays.Text = "Days Count is : " + days.ToString();
}
Screenshot