I'm just starting out with DayPilot...
I'm using the ajax modal dialog for displaying the freetimeclick start date and time (as a test), but I get two copies of the dialog one after the other.One gets displayed andthen disappears, and then the second onewhich has the valuesI actually want displayed.
The first one dialog that is shown uses the values from the last postback (or no value if this is the first postback). The second version of the dialogue shows the correct values, as handled by the server-side event handler on this postback.
If I place a breakpoint on the server side code, I notice that the first modal is displayed purely by client-side code - that is, no postback occurs before the dialog is displayed. After the first dialog disappears, the postback event is handled and the second version of the dialog is shown.
My ASPX code:
<DayPilot:DayPilotCalendar ID="dpcClinic" runat="server" Days="5"
OnEventClick="DayPilot_EventClick" OnFreeTimeClick="DayPilot_FreeTimeClick"
HeaderDateFormat="D" EventClickHandling="PostBack"
FreetimeClickHandling="PostBack" DataEndField="ApptEnd"
DataStartField="ApptStart" DataTextField="ApptDesc" DataValueField="ApptID"></DayPilot:DayPilotCalendar>
<cc1:ModalPopupExtender ID="mpeAddBooking" runat="server"
PopupControlID="pnlAddBooking" TargetControlID="dpcClinic"
CancelControlID="cmdAddCancel" BackgroundCssClass="modalBackground"
EnableViewState="false">
</cc1:ModalPopupExtender>
<asp:Panel runat="server" ID="pnlAddBooking" CssClass="modalPopup" style="display: none;">
<div>
<p><asp:Label ID="lblBookingStart" runat="server" Text=""></asp:Label></p>
<p><asp:Button ID="cmdAddCancel" runat="server" Text="Cancel" /></p>
</div>
</asp:Panel>
...And my VB code:
Protected Sub DayPilot_FreeTimeClick(ByVal sender As Object, ByVal e As DayPilot.Web.Ui.FreeClickEventArgs) Handles dpcClinic.FreeTimeClick
'Some event handling
Me.lblBookingStart.Text = "Start date selected as: " + e.Start.ToShortDateString
Me.lblBookingStart.Text += "<br />Start time selected as: " + e.Start.ToShortTimeString
Me.mpeAddBooking.Show()
End Sub