Add Check Box in Calender Control and Select WeekEnds on click of Button

Posted by Chikul under ASP.NET category on | Views : 1910
Partial Class SelectWeekEnds
Inherits System.Web.UI.Page

Dim btnclick As Boolean = False

Protected Sub Calendar1_DayRender(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DayRenderEventArgs) Handles Calendar1.DayRender
Dim ctl As New CheckBox
ctl.ID = "chk" & e.Day.Date.ToString.Substring(0, 10)
If btnclick = True Then
If CInt(e.Day.Date.DayOfWeek) = 0 Or CInt(e.Day.Date.DayOfWeek) = 6 Then
ctl.Checked = True
End If
End If
End Sub

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
btnclick = True
End Sub

End Class

Comments or Responses

Login to post response