Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get current month from calendar control

Status
Not open for further replies.

thehms

Programmer
Jul 3, 2003
58
0
0
AE
hi all...

i have a website that shows scheduled events. i am using the calendar control to view the days that have events in them by shading them.

i get the dates from SQL server, by having a stored rocedure tha selects the events according to this months month..

my problem is that when i want to see the events in any other month i cant, because i cannot extract the month number from the calendar control to pass it to the sql stored procedure.

how can i get the current displayed month on the calendar control?

Thanx...
The HMS
 
i got it... :)

i added this eventHandler:
Code:
public void Calendar1_VisibleMonthChanged(object sender, MonthChangedEventArgs e)
		{
			Response.Write("You moved from month " + e.PreviousDate.Month + " to month " + e.NewDate.Month + ".");
		}

and i added this in the page initialization:
Code:
			this.Calendar1.VisibleMonthChanged += new System.Web.UI.WebControls.MonthChangedEventHandler(this.Calendar1_VisibleMonthChanged);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top