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 month in the Calendar1_SelectionChanged Event handler

Status
Not open for further replies.

thehms

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

here is the scenario i am facing:

I have a page with a calendar control that shows all the events of the current month (i.e. it if you open he page now it will show anuary Events). my problem lied in that when i move to either the previous or next months it didnt load the events of these months. i fixed this problem by creating the event Calendar1_VisibleMonthChanged and i was able to lod the events of each month as i scroll through them.

now when i click on any day of the month it calls the Calendar1_SelectionChanged eventhandler and it in turn checks to see whether there is an event on that day or not y checking ti against the database. i there is it redirects to apge with all the details of that event, if not, it gives a message that there are no events on that day.

my problem is that when i move to another month (say December) and i click on a day where there is an event it tells me there r no events. this hapens because the Calendar1_SelectionChanged event handler calls all events of the current month (January) and when my selection of the December event is checked against them it doesnt find any event.

i want to get the month number whil i am in the Calendar1_SelectionChanged eventhandler. how can i do this?

Thank you,
The HMS
 
hi BoulderBum!

this will get me the month if i select a date in a diffferent month... i want to get the month without selecting any date, just by moving to the next or previous month it should automatically get me the month number...

The HMS
 
nope...

it didnt work, it gets the month also if i selected a date..

 
I guess I don't understand what you want. Do you want to re-populate the calendar when the user moves to a different month?

How that works is you hook the VisibleMonthChanged event and look at e.NewDate to fetch your data, then let the DayRender event handler use the new data.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top