Calendar Control And Events

Sun, 20 Dec 2009 05:52:02 GMT Posted by mfalac

' Clear the current text.
       Message.Text = ""

       ' Iterate through the SelectedDates collection and display the
       ' dates selected in the Calendar control.
       Dim day As DateTime

       For Each day In Calendar1.SelectedDates

           Message.Text &= day.Date.ToShortDateString() & "<br>"

       Next


For Each ArticleRow As DataSetCalendarEvents.BlogArticlesRow In ArticleDayNumber
    If e.Day.Date.Date = ArticleRow.ArticleDate.Date Then
        Dim T As String = ArticleRow.ArticleTitle.ToString()
        Dim Id As String = ArticleRow.ArticleId.ToString()

        e.Cell.Controls.Add(New LiteralControl("<br/>-<a href='../Blog/BlogView.aspx?ArticleId=" + Id + "'>" + T + "</a>"))

Sub MonthChange(sender As Object, e As MonthChangedEventArgs)

         If e.NewDate.Month > e.PreviousDate.Month Then

            Message.Text = "You moved forward one month."

         Else

            Message.Text = "You moved backwards one month."

         End If

      End Sub

    End If
Next