Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Get the month and year of Calendar that current displaying

Reply
Thread Tools

Get the month and year of Calendar that current displaying

 
 
=?Utf-8?B?SmFzb24gQ2hhbg==?=
Guest
Posts: n/a
 
      11-23-2005
How can I get the month and year a calendar control current displaying?

My problem is I want to load a list of event to a calendar so that it
display difference style if there a event for a day.

My initial idea is load all events from database and store it in a
DataTable. In the DayRender event, loop thr the DataTable and see if it equal
to e.Day and alter the style if that is.

However when the event table is large, it hurt performance. So how get I
know what month and year the calendar control is current displaying, thus I
can only load the events of specified month and year only?

Thanks in advance.

Jason
 
Reply With Quote
 
 
 
 
Rob Meade
Guest
Posts: n/a
 
      11-23-2005
"Jason Chan" wrote ...

> However when the event table is large, it hurt performance. So how get I
> know what month and year the calendar control is current displaying, thus
> I
> can only load the events of specified month and year only?
>
> Thanks in advance.


Hi Jason,

I'm not overly familiar with the calendar control, however, from memory,
cant you access the "selecteditem" - if so, you should be able to get the
date from that - thus breaking it up and getting the month and year...

Again not overly familiar with it - but that should work I think...

Regards

Rob


 
Reply With Quote
 
 
 
 
Brock Allen
Guest
Posts: n/a
 
      11-23-2005
Calendar.VisibleDate

-Brock
DevelopMentor
http://staff.develop.com/ballen

> How can I get the month and year a calendar control current
> displaying?
>
> My problem is I want to load a list of event to a calendar so that it
> display difference style if there a event for a day.
>
> My initial idea is load all events from database and store it in a
> DataTable. In the DayRender event, loop thr the DataTable and see if
> it equal to e.Day and alter the style if that is.
>
> However when the event table is large, it hurt performance. So how get
> I know what month and year the calendar control is current displaying,
> thus I can only load the events of specified month and year only?
>
> Thanks in advance.
>
> Jason
>



 
Reply With Quote
 
Jason Chan
Guest
Posts: n/a
 
      11-23-2005
It doesn't work, i have a test.aspx with a Label and a Calendar, with
following code

protected void Page_Load(object sender, EventArgs e)
{
Label1.Text = Calendar1.VisibleDate.ToString();
}

The Label1 show "1/1/0001 0:00:00" when the page first loaded, currently
month/year is Nov, 2005
When I click the nextMonth link, Calendar current displaying Dec, 2005,
however the Label1 show "1/1/0001 0:00:00",
When I click the nextMonth again, The Calendar now is Jan, 2006, but the
Label is "1/12/2005 0:00:00"
Then I click prevMonth, The Calendar back to Dec 2005, the Label shows
"1/1/2006 0:00:00"

It seem the VisibleDate always keep the previous value, and initial
undefined when the page first load.
Anyone can explain the behavior?

Or how you guys implements a event calendar?

Thanks in advance



"Brock Allen" <(E-Mail Removed)>
???????:(E-Mail Removed) oft.com...
Calendar.VisibleDate

-Brock
DevelopMentor
http://staff.develop.com/ballen

> How can I get the month and year a calendar control current
> displaying?
>
> My problem is I want to load a list of event to a calendar so that it
> display difference style if there a event for a day.
>
> My initial idea is load all events from database and store it in a
> DataTable. In the DayRender event, loop thr the DataTable and see if
> it equal to e.Day and alter the style if that is.
>
> However when the event table is large, it hurt performance. So how get
> I know what month and year the calendar control is current displaying,
> thus I can only load the events of specified month and year only?
>
> Thanks in advance.
>
> Jason
>




 
Reply With Quote
 
Jason Chan
Guest
Posts: n/a
 
      11-23-2005
This doesn;t work, since when the page first loaded, no date is selected.


"Rob Meade" <(E-Mail Removed)> glsD:eF$(E-Mail Removed) bl...
"Jason Chan" wrote ...

> However when the event table is large, it hurt performance. So how get I
> know what month and year the calendar control is current displaying, thus
> I
> can only load the events of specified month and year only?
>
> Thanks in advance.


Hi Jason,

I'm not overly familiar with the calendar control, however, from memory,
cant you access the "selecteditem" - if so, you should be able to get the
date from that - thus breaking it up and getting the month and year...

Again not overly familiar with it - but that should work I think...

Regards

Rob



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cal control - pre selecting a date from last month - and the calendar still shows this month. Mufasa ASP .Net 0 09-05-2008 06:51 PM
verifying a date is valid based on integer values for year, month and day of month lbrtchx@hotmail.com Java 1 12-22-2006 08:24 PM
Find First Date of A Calendar Month\Year idgarad@gmail.com Perl Misc 7 10-06-2006 04:50 PM
displaying only current month dates asp.net calendar control prasanthamohan Software 0 07-18-2006 06:43 AM
calendar control : how to retrieve the "shown" month and year tfsmag ASP .Net 8 06-17-2005 04:27 PM



Advertisments