I'm having the same problem, what is wrong with my code?
in default.aspx:
<form id="form1" runat="server">
<div>
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td width="160" valign="top">
<asp:UpdatePanel ID="UpdatePanelNavigation" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Calendar ID="Calendar1" runat="server" CssClass="calendar" DayNameFormat="FirstTwoLetters">
<TodayDayStyle BorderColor="Red" BorderStyle="Solid" BorderWidth="1px"></TodayDayStyle>
<SelectedDayStyle BackColor="#FBE694" ForeColor="Black" CssClass="selected"></SelectedDayStyle>
<TitleStyle BackColor="White"></TitleStyle>
<OtherMonthDayStyle ForeColor="#ACA899"></OtherMonthDayStyle>
</asp:Calendar>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
</ContentTemplate>
</asp:UpdatePanel>
</td>
<td width="20">
</td>
<td valign="top" width="100%">
<asp:UpdatePanel ID="UpdatePanelCalendar" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="false">
<ContentTemplate>
<DayPilot:DayPilotCalendar ID="DayPilotCalendar1" runat="server"
DataTextField="name" DataValueField="id" TimeFormat="Clock12Hours" EventClickHandling="PostBack"
DataStartField="eventstart" DataEndField="eventend" Days="7" OnEventClick="DayPilotCalendar1_EventClick"
OnFreeTimeClick="DayPilotCalendar1_FreeTimeClick"
></DayPilot:DayPilotCalendar>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
</table>
</div>
<asp:Label ID="Label1" runat="server" Text="Label1"></asp:Label>
</form>
below is from default.aspx.vb:
Protected Sub DayPilotCalendar1_FreeTimeClick(ByVal sender As Object, ByVal e As FreeClickEventArgs)
Label1.Text = "Time cell starting at " + e.Start & " clicked."
End Sub
Protected Sub DayPilotCalendar1_EventClick(ByVal sender As Object, ByVal e As EventClickEventArgs)
Label1.Text = "Event with ID " + e.Value & " clicked."
End Sub
Private Function dbGetEvents(ByVal start As DateTime, ByVal days As Integer) As DataTable
Dim da As New Data.SQLite.SQLiteDataAdapter("SELECT [id], [name], [eventstart], [eventend] FROM [event] WHERE NOT (([eventend] <= @start) OR ([eventstart] >= @end))", ConfigurationManager.ConnectionStrings("db").ConnectionString)
da.SelectCommand.Parameters.AddWithValue("start", start)
da.SelectCommand.Parameters.AddWithValue("end", start.AddDays(days))
Dim dt As New DataTable()
da.Fill(dt)
Return dt
End Function
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Request.Browser.Browser = "Firefox" Then
Response.Cache.SetNoStore()
End If
If Not IsPostBack Then
DayPilotCalendar1.StartDate = DayPilot.Utils.Week.FirstDayOfWeek()
' select full week in the Calendar control
Dim i As Integer
For i = 0 To 7 - 1 Step i + 1
Dim selected As DateTime = DayPilotCalendar1.StartDate.AddDays(i)
Calendar1.SelectedDates.Add(selected)
Next
DayPilotCalendar1.DataSource = dbGetEvents(DayPilotCalendar1.StartDate, DayPilotCalendar1.Days)
DataBind()
End If
End Sub