0

Hi,
I just need to get all the months or monthid between 2 dates like '02/04/2012' and '08/07/2013'.
I search it for a long time. But i get only the date difference.
Can i get this in asp.net.

regards,
sreevidya

3
Contributors
3
Replies
4
Views
5 Years
Discussion Span
Last Post by ssreevidya.m
0

You can get it but you have to search for your desired things,
Wish you all the best

0

I think This Will help you..

protected void Calendar1_SelectionChanged(object sender, EventArgs e)
        {
            TextBox1.Text = Calendar1.SelectedDate.ToShortDateString();
            TextBox3.Text = "";
        }

        protected void Calendar2_SelectionChanged(object sender, EventArgs e)
        {
            TextBox2.Text = Calendar2.SelectedDate.ToShortDateString();
            TextBox3.Text = "";
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            int i = 0;
            if (Calendar1.SelectedDate.Year < Calendar2.SelectedDate.Year)
            {
                int diffyr = Calendar2.SelectedDate.Year - Calendar1.SelectedDate.Year;
            }
            int diff = Calendar2.SelectedDate.Month - Calendar1.SelectedDate.Month;
            for (i = 0; i < diff; i++)
            {
                TextBox3.Text += Calendar1.SelectedDate.AddMonths(i).ToString("MMMMM")+"\n";
            }

        }
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.