Ask a Question related to ASP.NET General, Design and Development.
-
Michael Evanchik #1
Cant add events to HTML controls in a Calander control
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" />
Michael Evanchik Guest
-
Embeding html controls in Server Control
Hi Everyone, I have some HTML snippets (with about 15 HTML controls) that needs to be embedded into my server control. I need these HTML controls... -
Add controls to my custom control with tags in HTML design view
I have created a custom control but would like to add other controls to it at design time. I want to be able to put custom control tags inside the... -
calander control
where can i find a nice looking calander control to implement in an html page ? cheers -
Web User Control Events vs. Controls Content
I have a textbox embedded in a DataGrid which in turn is part of a web user control. I want to save any changes made to the text on postback. This... -
Nesting server controls with a composite control don't generate postback events
Hi, I am new to web controls so please forgive me if my terminology is not 100%! I am attempting to develop a composite control, based heavily... -
Yan-Hong Huang[MSFT] #2
RE: Cant add events to HTML controls in a Calander control
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! - [url]www.microsoft.com/security[/url]
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
!From: [email]mcbain@aol.com[/email] (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: [url]http://groups.google.com/[/url]
!Lines: 15
!Message-ID: <73446b8b.0307291016.1cf44caa@posting.google.com >
!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: [email]groups-abuse@google.com[/email]
!NNTP-Posting-Date: 29 Jul 2003 18:16:52 GMT
!Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed 00.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" />
!
Yan-Hong Huang[MSFT] Guest
-
Michael Evanchik #3
Re: Cant add events to HTML controls in a Calander control
nope you hit on on the "button", unfortunate
Thanks
Michael Evanchik Guest
-
Yan-Hong Huang[MSFT] #4
Re: Cant add events to HTML controls in a Calander control
Hello Michael,
Please post here if you have any follow up questions.
Besides, regarding adding more functionality to calendars, try this:
Normally you have to click the text inside the cell. With this calendar you can click anywhere within the cell.
Private Sub Calendar1_DayRender(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DayRenderEventArgs) Handles Calendar1.DayRender
e.Cell.Attributes.Item("onclick") = "javascript:__doPostBack('Calendar1','" & DateDiff(DateInterval.Day, #1/1/2000#,
e.Day.Date) & "');"
End Sub
Thanks.
Best regards,
Yanhong Huang
Microsoft Online Partner Support
Get Secure! - [url]www.microsoft.com/security[/url]
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
!From: [email]mcbain@aol.com[/email] (Michael Evanchik)
!Newsgroups: microsoft.public.dotnet.framework.aspnet
!Subject: Re: Cant add events to HTML controls in a Calander control
!Date: 31 Jul 2003 08:35:14 -0700
!Organization: [url]http://groups.google.com/[/url]
!Lines: 3
!Message-ID: <73446b8b.0307310735.6e124624@posting.google.com >
!References: <73446b8b.0307291016.1cf44caa@posting.google.com > <wY7b#5zVDHA.2160@cpmsftngxa06.phx.gbl>
!NNTP-Posting-Host: 24.44.204.68
!Content-Type: text/plain; charset=ISO-8859-1
!Content-Transfer-Encoding: 8bit
!X-Trace: posting.google.com 1059665715 23827 127.0.0.1 (31 Jul 2003 15:35:15 GMT)
!X-Complaints-To: [email]groups-abuse@google.com[/email]
!NNTP-Posting-Date: 31 Jul 2003 15:35:15 GMT
!Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed 00.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:163809
!X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
!
!nope you hit on on the "button", unfortunate
!
!Thanks
!
Yan-Hong Huang[MSFT] Guest



Reply With Quote

