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
I want to use this on my page behind. I found this code on line. I am not able to fix the syntax. Thanks
VB.NET:
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("javascript: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
Last edited by a moderator: