Hello Michael,
Thanks very much for posting here.
Based on my understanding, now the question is: You added some controls to calendar control in DayRender event. Now
you wanted to know how to add event handlers to these added controls. Please let me know if I have misunderstood the
question.
Since the DayRender event is raised while the Calendar control is being rendered, you cannot add a control that can also
raise an event, such as LinkButton. You can only add static controls, such as System.Web.UI.LiteralControl, Label, Image,
and HyperLink. This is a limitation of Calendar control. This is documented in the Remarks section in the help of
Calendar.DayRender Event.
If you have any more concerns on it, please post here. Thanks.
Best regards,
Yanhong Huang
Microsoft Online Partner Support
Get Secure! -
www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
!From: (e-mail address removed) (Michael Evanchik)
!Newsgroups: microsoft.public.dotnet.framework.aspnet
!Subject: Cant add events to HTML controls in a Calander control
!Date: 29 Jul 2003 11:16:51 -0700
!Organization:
http://groups.google.com/
!Lines: 15
!Message-ID: <
[email protected]>
!NNTP-Posting-Host: 216.66.24.116
!Content-Type: text/plain; charset=ISO-8859-1
!Content-Transfer-Encoding: 8bit
!X-Trace: posting.google.com 1059502612 21298 127.0.0.1 (29 Jul 2003 18:16:52 GMT)
!X-Complaints-To: (e-mail address removed)
!NNTP-Posting-Date: 29 Jul 2003 18:16:52 GMT
!Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-online.de!news-spur1.maxwell.syr.edu!
news.maxwell.syr.edu!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!postnews1.google.com!not-for-mail
!Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:163073
!X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
!
!Im not getting any error messages but the event is not going off when
!i click the button it just posts back to the same page. I know this
!code has worked outside of Calanders with the same code. Anyone have
!any ideas?
!
! While rdz.Read()
! lb(rdz("id")) = New Button
! lb(rdz("id")).ID = "lb" & rdz("id")
! lb(rdz("id")).Text = rdz("lloyds_num")
! AddHandler lb(rdz("id")).Click, AddressOf dayclickz
! ctlCell.Controls.Add(lb(rdz("id")))
! End While
!
!<asp:Calendar OnDayRender="Calendar_RenderDay" id="myCal"
!SelectionMode="None" Runat="server" />
!