Hey nauna,
Please refer below sample.
HTML
<link href="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.9.2/themes/blitzer/jquery-ui.css"
rel="Stylesheet" type="text/css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://cdn.rawgit.com/dubrox/Multiple-Dates-Picker-for-jQuery-UI/master/jquery-ui.multidatespicker.css" />
<script type="text/javascript" src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js"></script>
<script type="text/javascript" src="https://cdn.rawgit.com/dubrox/Multiple-Dates-Picker-for-jQuery-UI/master/jquery-ui.multidatespicker.js"></script>
<script type="text/javascript">
var $j = $.noConflict(true);
</script>
<script type="text/javascript">
$j(function () {
$j('[id*=txtFrom]').multiDatesPicker({
dateFormat: 'dd/M/yy'
});
$j('[id*=txtTo]').multiDatesPicker({
dateFormat: 'dd/M/yy'
});
});
</script>
From :
<asp:TextBox ID="txtFrom" runat="server"></asp:TextBox>
<br />
To :
<asp:TextBox runat="server" ID="txtTo"></asp:TextBox>
<asp:Button Text="Submit" runat="server" OnClick="GetDates" />
Code
C#
protected void GetDates(object sender, EventArgs e)
{
string result = "";
List<DateTime> listDate = new List<DateTime>();
DateTime start = DateTime.Parse(txtFrom.Text);
DateTime end = DateTime.Parse(txtTo.Text);
for (DateTime dt = start; dt <= end; dt = dt.AddDays(1))
{
listDate.Add(dt);
result += dt.ToString("dd/MMM/yyyy") + ",";
}
Response.Write(result.TrimEnd(','));
}
VB.Net
Protected Sub GetDates(ByVal sender As Object, ByVal e As EventArgs)
Dim result As String = ""
Dim listDate As List(Of DateTime) = New List(Of DateTime)()
Dim start As DateTime = DateTime.Parse(txtFrom.Text)
Dim [end] As DateTime = DateTime.Parse(txtTo.Text)
Dim dt As DateTime = start
While dt <= [end]
listDate.Add(dt)
result += dt.ToString("dd/MMM/yyyy") & ","
dt = dt.AddDays(1)
End While
Response.Write(result.TrimEnd(","c))
End Sub
Screenshot