Calendar DayRender  
Author Message
Saruk





PostPosted: .NET Base Class Library, Calendar DayRender Top

Can you please change the syntax to this pc of code.
I want to use this on my page behind. I found this code on line. I am not able to fix the syntax. Thanks

Private Sub Calendar1_DayRender(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DayRenderEventArgs) Handles Calendar1.DayRender
'Clear the link from this day
e.Cell.Controls.Clear()
'Add the custom link
System.Web.UI.HtmlControls.HtmlGenericControl(Link = New System.Web.UI.HtmlControls.HtmlGenericControl)
Link.TagName = "a"
Link.InnerText = e.Day.DayNumberText
Link.Attributes.Add("href", String.Format(window.opener.document.{0}.value = \'{1:d}\'; window.close();", Request.QueryString["field"], e.Day.Date))
'By default, this will highlight today's date.
If (e.Day.IsSelected) Then
Link.Attributes.Add("style", this.Calendar1.SelectedDayStyle.ToString());
'Now add our custom link to the page
e.Cell.Controls.Add(Link)
End Sub



.NET Development36  
 
 
duck thing





PostPosted: .NET Base Class Library, Calendar DayRender Top

Despite my best efforts I was unable to psychically determine what's wrong with your code. Can you provide a bit more information, like what errors you're seeing

System.Web.UI.HtmlControls.HtmlGenericControl(Link = New System.Web.UI.HtmlControls.HtmlGenericControl)

Okay, I do see one thing. I don't have a clue what this line is intended to do and I'd be surprised if it even compiles.