in the frontend side write a c# function
private void GetDates(DateTime givenDate, out DateTime firstDate, out DateTime lastDate)
{
int date = givenDate.Day;
int mon = givenDate.Month;
int year = givenDate.Year;
int noOfdays = DateTime.DaysInMonth(year, mon);
firstDate = new DateTime(year, mon, 1);
lastDate = new DateTime(year, mon, noOfdays);
}
and you can get that as
DateTime firstDate, lastdate, givendate;
givendate = Convert.ToDateTime(textBox3.Text);
GetDates(givendate, out firstDate, out lastdate);
textBox1.Text = firstDate.ToShortDateString();
textBox2.Text = lastdate.ToShortDateString();
Thanks and Regards
Madhu
Laghaterohan, if this helps please login to Mark As Answer. | Alert Moderator