By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,319 Members | 2,115 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,319 IT Pros & Developers. It's quick & easy.

One of 12 Calendars DayRender event does not work on PostBack

P: n/a
I have a form that has 12 Calendar, 1 for each month. I am retrieving
information from a database separately, assigning them to an array and then
in the DayRender Event, itterating through the array to mark the days that I
have in the database for each calendar. Basically a year view of what dates
are blocked and what days are free. Booking calendar.

The problem is that when the page posts back, the first 11, Jan-Nov,
calendars work. December's postback blanks out all dates as if it has
nothing marked. However, if I close the page and open it again, then
December's calendar works fine. It is only on PostBack that the callendar
does not fire the PostBack event.

Is there a limit for how many calendars one can use on a page?

Is there another way to force the DayRender event to trigger?

How can I verify that all of the DayRender Events have been triggered.

Below is my DayRender Code only for 2 caledars. Notice they are exactly the
same, except for the calendar ID.

Private Sub Calendar11_DayRender(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DayRenderEventArgs) Handles Calendar11.DayRender
Dim c As Integer
For c = 0 To x - 1
If e.Day.Date.Month = Month(datinf(c)) Then
If e.Day.Date.Day = Day(datinf(c)) = True Then
e.Cell.BackColor = System.Drawing.Color.Red
End If
End If
Next c
End Sub
Private Sub Calendar12_DayRender(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DayRenderEventArgs) Handles Calendar12.DayRender
Dim c As Integer
For c = 0 To x - 1
If e.Day.Date.Month = Month(datinf(c)) Then
If e.Day.Date.Day = Day(datinf(c)) = True Then
e.Cell.BackColor = System.Drawing.Color.Red
End If
End If
Next c
End Sub

Nov 29 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.