search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

ModalPopupExtender does not popup

Asked by Eunice Harris
10 years ago.

My ModalPopupExtender does not popup when I click on an event and want to edit, it appears below the DayPilotCalendar with the event data populated (this part is correct). I want it to popup. Here is the portion of my html:

<asp:Button ID="ButtonDummy" runat="server" Visible="false"></asp:Button>
<asp:ModalPopupExtender ID="ModalPopup" runat="server" TargetControlID="ButtonDummy"
PopupControlID="pnlPopup" BackgroundCssClass="modalBackground" />
<asp:Panel ID="pnlPopup" runat="server" Style=" visibility:inherit" Width="500px" CssClass="modalPopup">
<asp:UpdatePanel ID="UpdatePanelDetail" runat="server" UpdateMode="Conditional">
TIAFYH
Eunice Harris

Comment posted by Eunice Harris
10 years ago.

also how do i use DayPilotCalendar.OnTimeRangeSelected to populate the ModalPopupExtender with the start and end date values?

Answer posted by Dan Letecky [DayPilot]
10 years ago.

Please take a look at this tutorial:

http://www.daypilot.org/tutorial-calendar-sqlserver.html

You have to call pnlPopup.Show() from the code behind to display the modal popup.

However, my advice is to use the DayPilot.Modal helper to display a modal dialog instead of the ModalPopupExtender. It displays a standalone page using an iframe and the integration logic is much easier.

See also:
http://code.daypilot.org/81367/daypilot-modal

It is used in most of the recent sample projects, such as the day/week/month calendar:
http://code.daypilot.org/18967/event-calendar-with-day-week-month-views-for-asp-net-webfor

Comment posted by Eunice Harris
10 years ago.

I reviewed http://www.daypilot.org/tutorial-calendar-sqlserver.html , and the only difference I see is in
<asp:Panel ID="pnlPopup" runat="server" Style="display: none" CssClass="modalPopup"
Width="500px">
this has " Style="display: none" ", but when I try that nothing shows at all. At least when I use
"Style=" visibility:inherit" " then it shows below the calendar.

Comment posted by Eunice Harris
10 years ago.

I really want to use DayPilot, but I know ASP.Net Webforms, wheras I do not understand javascript. So any help on TimeRangeSelectedHandling=Postback would help. I am trying to pass the start and end that were just selected to the modal popup.

Comment posted by Eunice Harris
10 years ago.

sorry, one more comment. There is no pnlPopup.Show(). I use the ModalPopup.Show(), but that shows the data below the calendar not in a popup.

Comment posted by Dan Letecky [DayPilot]
10 years ago.

Sorry for the confusion: You are correct - it should be ModalPopup.Show() rather than pnlPopup.Show().

I have re-created the sample project using Visual Studio, .NET Framework 3.5, the latest Ajax Control Toolkit and the latest DayPilot Pro (7.7). You can download it here:

http://code.daypilot.org/57459/event-calendar-and-modalpopupextender

The tutorial describes the key parts of the code (both the .aspx and the code behind).

The sample code is simplified:

  • it doesn't use DetailsView (the DetailsView binding logic adds complexity)
  • there are separate dialogs for event creating (ModalPopupCreate) and editing (ModalPopupEdit)

If the modal popup displays at the right time (on time range selection) but at the wrong place you may need to review the CSS and/or placement of the Panel with the dialog content. If you use complex page layout it may affect the correct placement (normally it should be re-positioned automatically using the ModalPopupExtender).

I would recommend trying it on a blank page (like in the updated tutorial) or to disable the global CSS styles temporarily to see if it makes any difference.

Comment posted by Eunice Harris
10 years ago.

this really helps. I guess I have to move away from DetailsView, and put all the data as asp textboxes and such and link by sqlDataSource parameters, which to me complicates it further, rather than simplifies. I'll be asking more questions I'm sure, but I'm a little step closer to purchasing. I showed what I have to my supervisor, and she likes it.

Comment posted by Dan Letecky [DayPilot]
10 years ago.

Thanks for the update. Yes, I agree with the DetailsView. It' not easy to deal with (the binding and event logic is too heavy-weight for a few texboxes).

Let me know if you need any help.

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.