473,545 Members | 2,782 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

One of 12 Calendars DayRender event does not work on PostBack

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_DayR ender(ByVal sender As Object, ByVal e As
System.Web.UI.W ebControls.DayR enderEventArgs) Handles Calendar11.DayR ender
Dim c As Integer
For c = 0 To x - 1
If e.Day.Date.Mont h = Month(datinf(c) ) Then
If e.Day.Date.Day = Day(datinf(c)) = True Then
e.Cell.BackColo r = System.Drawing. Color.Red
End If
End If
Next c
End Sub
Private Sub Calendar12_DayR ender(ByVal sender As Object, ByVal e As
System.Web.UI.W ebControls.DayR enderEventArgs) Handles Calendar12.DayR ender
Dim c As Integer
For c = 0 To x - 1
If e.Day.Date.Mont h = Month(datinf(c) ) Then
If e.Day.Date.Day = Day(datinf(c)) = True Then
e.Cell.BackColo r = System.Drawing. Color.Red
End If
End If
Next c
End Sub

Nov 29 '05 #1
0 1082

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1465
by: CodeRazor | last post by:
Hi, I have been using the DayRender event of the calendar control to format the appearance of my calendar control, and it works ok. However, because of the way the DayRender event works, it will fire once for each day in the calendar control, so if i am displaying july, it will fire 31 times, even if i only require formatting for 2...
2
7550
by: Bruce W..1 | last post by:
I want to change the display style of certain days in my Calendar control. This is done with the DayRender event. So I put this in the codebehind: private void Calendar1_DayRender (object sender, System.Web.UI.WebControls.DayRenderEventArgs e) { // Display weekend dates in green boxes. Style weekendStyle = new Style();...
2
4567
by: VB Programmer | last post by:
How can I force the DayRender event of my Calendar to run/refresh? The calendar displays data from a database and I am allowing the user to filter out what data they see on the calendar. When they click "Update Calendar" I want to force the DayRender events to reprocess. I don't want to simply do a response.redirect to the page. Thanks.
6
3357
by: Steve Booth | last post by:
I have a web form with a button and a placeholder, the button adds a user control to the placeholder (and removes any existing controls). The user control contains a single button. I have done all the usual stuff of recreating the usercontrol in the Page Init event. The 'failure' sequence is as follows: - select web form button to display...
1
2044
by: Mariano Padilla | last post by:
I poste the below on 11-28-05 and got no answer. Could anyone please help me? 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. ...
1
1937
by: Peter | last post by:
I tried to initialize a date in Calendar control with DayRender event handler as the following code: protected void Calendar1_DayRender(object sender, DayRenderEventArgs e){ e.Cell.ForeColor = System.Drawing.Color.Pink; Calendar1.SelectedDate = new DateTime(2002, 7,16); } The first line works by seeing pink color. The second line does not...
2
3902
by: John Kotuby | last post by:
Hi guys, I am converting a rather complicated database driven Web application from classic ASP to ASP.NET 2.0 using VB 2005 as the programming language. The original ASP application works quite well, so at times it is tempting just to port parts of it over mostly as-is. In fact, one MSDN article I read suggested using straight HTML wherever...
0
998
by: dodjem | last post by:
Hi all, I have search far and wide for a solution but have been unsuccessful. I have a database table which contains bookings for resources that can be used in our lab and some bookings can span over several days - minimum one day booking. I can get bookings to display the user of the item on the start date of the booking using the...
0
1738
by: champagne.supernova1974 | last post by:
Hi Can anyone help with a quick question? I am adding a textbox into each "day" cell of a calendar control, by using the following code in the DayRender event: Protected Sub Calendar1_DayRender(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DayRenderEventArgs) Handles
0
7499
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7432
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7689
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7943
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7786
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5359
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5076
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3490
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3470
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.