AJAX Calendar/Scheduling Controls
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
I also notice that a property reference for the ModalPopupExtender is appearing in the properties list for the DayPilotCalendar.
Would this somehow be related to whythe modal is activating before the postback event that shows the modal?
PS: I'm using VS2008 SP1, with solution targetting framework 3.5 (also SP1), in case that's relevant to the behaviour I'm seeing.
Sorted it - found the answer in your DemoSQL examples, by adding the dummy button for the target control of the modal.
DayPilot for ASP.NET WebForms, DayPilot for ASP.NET MVC, DayPilot for Java