I am not sure that this is a bug or not. While I was testing the new month-view I encountered the following 'bug'. To reproduce it, follow the following steps:
Create new page
Add ScriptManager and UpdatePanel
Add Multiview with 2 views (View1 and View2)
Add 2 buttons
In View1; place a DayPilotCalendar
In View2: place a DayPilotMonth
Add actions to the buttons: MultiView1.SetActiveView(View1) and MultiView1.SetActiveView(View2)
Run website & view the javascript errors saying it doesn't know the DayPilot objects
It is probably a bad thinking of me as the object is not sent to the client at all when the page is first loaded (no view is set). After a postback by ajax it (the javascript) will try to overwrite the object which should be on te page. That is not the case because it was not rendered before (no view was set).
Thanks for reporting it. The problem seems to be in the initialization JavaScript.
The JavaScript code is split into two parts:
General stuff that doesn't change with PostBacks (the libraries, the DayPilot client-side objects creating, etc.)
Code that changes after PostBack (values initialization).
The part #2 uses methods of ASP.NET AJAX Extensions to include the code in the page. That ensures it is properly executed after a partial PostBack.
But it still expects that part #1 was included properly which is not the case if it's on an invisible View.
I will need to play with the JavaScript including a little bit in order to fix this.
The following workaround can be used by that time: Put DayPilotCalendar and DayPilotMonth into TabPanels (inside a TabContainer) from Ajax Control Toolkit. The whole TabContainer can be inside an UpdatePanel. Since it loads all the TabPanels during the initial page load it includes all the necessary JavaScript as well.
Comment posted by Anonymous 17 years ago.
Is this still an issue?
Comment posted by John REYNIER 16 years ago.
Hi,
it seems to still be a problem.
Here are the steps i followed :
Add an update panel
Inside updatepanel, add tab container
trigger the updatepanel refresh
code behind :
dynamically add tabcontrols. Each tabcontrol contains a dynamically added daypilot calendar
When trying to render the page, javascript error occurs : "DayPilotCalendar" is not defined.
I hope there's a way to workaround this problem.
Comment posted by John REYNIER 16 years ago.
As a workaround, i add to my page a daypilot calendar, which remains hidden.
This way, all needed javascript is present, and the error is gone. It's not a really nice solution, but i provides a way to make it work while this bug is not fixed.
Comment posted by Anonymous 15 years ago.
Hi,
I am using a DayPilotCalendar control on a user control, there is also a AJAX tab container, where I have three tabs, DayPilotCalendar is on all three tabs. But for one time is working only for onr tab only. Not on all three tabs as I change the tab. (e.g. if iI comment the first one then works for second and if I comment for second then it works for third one).
Please suggest If anybody has any idea.
Regards
Vivek Sharma
This question is more than 1 month old and has been closed. Please create a new question if you have anything to add.