Error: Sys.InvalidOperationException: Could not find UpdatePanel with ID.. . If it is being updated dynamically then it must be inside another UpdatePanel

4 posts, 0 answers
  1. Alex
    Alex avatar
    15 posts
    Member since:
    Nov 2010

    Posted 18 Apr 2011 Link to this post

    Hello,

    I am using Rad scheduler and it works fine for me in my local pc..
    but when i publish same to sharepoint webpart it gives me following error when changing date of calender
    Error: Sys.InvalidOperationException: Could not find UpdatePanel with ID . If it is being updated dynamically then it must be inside another UpdatePanel

    means whe i change date or view from day to week or month ,..nothing updated
    pls reply soon,

    thanks,
    bhora
  2. Kalina
    Admin
    Kalina avatar
    918 posts

    Posted 20 Apr 2011 Link to this post

    Hello Alex,

    Could you please explain your implementation in more details and provide a simplified working code to illustrate it?

    Greetings,
    Kalina
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  3. Alex
    Alex avatar
    15 posts
    Member since:
    Nov 2010

    Posted 22 Apr 2011 Link to this post

    I am using webpart and uploading it to sharepoint..
    usercontrol ascx code is as follow

    -------------------------------------------------------------------------------------------------
    <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="EventUC.ascx.cs" Inherits="MMSEvent.EventUC" %>

    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

    <style type="text/css">
        .style1
        {
            width: 269px;
        }
    </style>

    <%--<script type="text/javascript" src="Scripts/ui.core.js"></script>
    <script type="text/javascript" src="Scripts/ui.datepicker.js"></script>--%>
            <telerik:RadScriptManager runat="Server" ID="RadScriptManager1" />
            
            <script type="text/javascript">
                function postbk() {
                    _dopostback("btnShow", "btnShow_Click");
                }
                function OnClientAppointmentDoubleClick(sender, eventArgs) {
               
                    document.getElementById('scheduler').style.display = 'none';
                    document.getElementById('AddEvent').style.display = 'block';
                    document.getElementById("<%=txtName.ClientID %>").value = eventArgs._appointment._subject;
                    var dt = $find("<%= txtDate1.ClientID %>");
                    var mont = new Date(eventArgs._appointment._start.format('yyyy'), eventArgs._appointment._start.format('MM'), eventArgs._appointment._start.format('dd'), eventArgs._appointment._start.format('hh'), "00", "00", "00");
                    var mon2 = mont.getMonth() - 1;
                    dt.set_selectedDate(new Date(eventArgs._appointment._start.format('yyyy'), mon2, eventArgs._appointment._start.format('dd'), eventArgs._appointment._start.format('hh'), "00", "00", "00"));
                  
                    var arrQrStr = new Array();
                    // splits each of pair
                    var arr = eventArgs._appointment._description.toString().split(';');
                    document.getElementById("<%=txtDescription.ClientID %>").value =arr[1].toString();
                    document.getElementById("<%=txtVanue.ClientID %>").value = arr[2].toString();
                    document.getElementById("<%=ddlType.ClientID %>").selectedValue = arr[4].toString();
                    document.getElementById("<%=txtLink.ClientID %>").value = arr[3].toString();
                    document.getElementById("<%=hdnId.ClientID %>").value = arr[0].toString();
                 
    //                window.showModalDialog("WebForm1.aspx", window, "dialogWidth=300;dialogHeight=300;scroll=yes;center=yes;status=no;");
                    return false;
                }
                function AppointmentInserting(sender, eventArgs) {
                    document.getElementById("<%=hdnId.ClientID %>").value = '';
                    document.getElementById('scheduler').style.display = 'none';
                    document.getElementById('AddEvent').style.display = 'block';
                    
                    document.getElementById("<%=txtName.ClientID %>").value = '';
                    document.getElementById("<%=txtDescription.ClientID %>").value = '';
                    document.getElementById("<%=txtVanue.ClientID %>").value = '';
                    document.getElementById("<%=txtLink.ClientID %>").value = '';
    //                itemValue = eventArgs.get_item().get_value();
    //                itemText = eventArgs.get_item().get_text();
                  //  var SlotDate = contextMenuSlot.get_startTime();
                   // alert(Date(eventArgs.get_time().format('yyyy'), eventArgs.get_time().format('MM'), eventArgs.get_time().format('dd')-1, eventArgs.get_time().format('hh'), eventArgs.get_time().format('mm'), "00", "00"));
    //                alert(Date(eventArgs.get_time().format('yyyy'), eventArgs.get_time().format('MM'), eventArgs.get_time().format('dd'), eventArgs.get_time().format('hh'), eventArgs.get_time().format('mm'), "00", "00"));
                    var dt = $find("<%= txtDate1.ClientID %>");
                    var mont = new Date(eventArgs.get_time().format('yyyy'), eventArgs.get_time().format('MM'), eventArgs.get_time().format('dd'), eventArgs.get_time().format('hh'), "00", "00", "00");
                    var mon2=mont.getMonth() - 1;
                   
                    //                document.getElementById("<%=txtDate1.ClientID %>").get_dateInput().set_dateFormat("MM/dd/yyyy hh:mm");
                    //                document.getElementById("<%=txtDate1.ClientID %>").value = eventArgs.get_time().format('M/d/yyyy h:mm tt');
                  //  document.getElementById("<%=txtDate1.ClientID %>").selectedDate=Date(eventArgs.get_time().format('yyyy'), eventArgs.get_time().format('MM'), eventArgs.get_time().format('dd'), eventArgs.get_time().format('hh'), eventArgs.get_time().format('mm'), "00", "00");
                  //  document.getElementById("<%=txtDate1.ClientID %>").nodeValue = Date(eventArgs.get_time().format('yyyy'), eventArgs.get_time().format('MM'), eventArgs.get_time().format('dd'), eventArgs.get_time().format('hh'), eventArgs.get_time().format('mm'), "00", "00") ;
                   // document.getElementById("eveScheduler_txtDate1_calendar_SD").value = "[[" + eventArgs.get_time().format('yyyy') + "," + eventArgs.get_time().format('M') + "," + eventArgs.get_time().format('d') + "]]";
                  //  dt.value = Date(eventArgs.get_time().format('yyyy'), eventArgs.get_time().format('MM'), eventArgs.get_time().format('dd'), eventArgs.get_time().format('hh'), eventArgs.get_time().format('mm'), "00", "00");
                    dt.set_selectedDate(new Date(eventArgs.get_time().format('yyyy'), mon2, eventArgs.get_time().format('dd'), eventArgs.get_time().format('hh'), "00", "00", "00"));
           //       dt.set_selectedDate(new Date(eventArgs.get_time().format('yyyy'), eventArgs.get_time().format('MM'), eventArgs.get_time().format('dd'), eventArgs.get_time().format('hh'), eventArgs.get_time().format('mm'), "00", "00").format('dd/MM/yyyy HH:mm'));
    //                window.showModalDialog("WebForm1.aspx", window, "dialogWidth=300;dialogHeight=300;scroll=yes;center=yes;status=no;");
                    return false;
                }
                /* Firefox resize scrollable content */
                function hideScrollableArea(sender, eventArgs) {
                    if ($telerik.isFirefox)
                        $telerik.$('.rsContentScrollArea').css('overflow', 'hidden');
                }
                function showScrollableArea(sender, eventArgs) {
                    if ($telerik.isFirefox)
                        $telerik.$('.rsContentScrollArea').css('overflow', 'auto');
                }
         
            </script>
            <asp:HiddenField ID="hdnId" runat="server" />
          <div id="scheduler">
          <table>
          <tr>
          <td>
           <asp:Label ID="lblCalender" runat="server" Text="Event Calender"></asp:Label>
          </td>
          <td style="width:30%;"></td>
          <td>
           <asp:Label ID="lblUser" runat="server" Text="User :-"></asp:Label>
          
          </td>
          <td>
              <asp:DropDownList ID="ddlUser" runat="server">
              </asp:DropDownList>
          </td>
          <td>
              <asp:Button ID="btnShow" runat="server" Text="show"  OnClick="btnShow_Click" OnClientClick="postbk();" />
          </td>
           <td>
              <asp:Button ID="btnList" runat="server" Text="List" OnClick="btnList_Click" />
          </td>
          </tr>
          </table>
          <br />
            <telerik:RadAjaxManager runat="Server" ID="RadAjaxManager1">
                <AjaxSettings>
                    <telerik:AjaxSetting AjaxControlID="RadCalendar1">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="RadCalendar2" UpdatePanelRenderMode="Block" />
                            <telerik:AjaxUpdatedControl ControlID="RadScheduler1" LoadingPanelID="RadAjaxLoadingPanel1" UpdatePanelRenderMode="Block" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                    <telerik:AjaxSetting AjaxControlID="RadCalendar2">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="RadCalendar1" />
                            <telerik:AjaxUpdatedControl ControlID="RadScheduler1" LoadingPanelID="RadAjaxLoadingPanel1" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                   
                    <telerik:AjaxSetting AjaxControlID="RadScheduler1">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="RadScheduler1" LoadingPanelID="RadAjaxLoadingPanel1" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                </AjaxSettings>
            </telerik:RadAjaxManager>
            <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
            <div class="example-panel exampleContainer">
             
                <telerik:RadSplitter runat="server" ID="RadSplitter1" PanesBorderSize="0" Width="870px"
                    Height="552px">
                    <telerik:RadPane runat="Server" ID="leftPane" Width="230px" MinWidth="230" MaxWidth="300"
                        Scrolling="None" OnClientResizing="hideScrollableArea" OnClientResized="showScrollableArea"
                        OnClientExpanding="hideScrollableArea" OnClientExpanded="showScrollableArea"
                        OnClientCollapsing="hideScrollableArea" OnClientCollapsed="showScrollableArea">
                        <div class="calendar-title">Calendar</div>
                        <div class="calendar-container">
                            <telerik:RadCalendar runat="server" ID="RadCalendar1"  AutoPostBack="true"
                                EnableMultiSelect="false" DayNameFormat="FirstTwoLetters" EnableNavigation="true"
                                EnableMonthYearFastNavigation="false" OnSelectionChanged="RadCalendar1_SelectionChanged"
                                OnDefaultViewChanged="RadCalendar1_DefaultViewChanged">
                            </telerik:RadCalendar>
                            <telerik:RadCalendar runat="server" ID="RadCalendar2"  AutoPostBack="true"
                                EnableMultiSelect="false" DayNameFormat="FirstTwoLetters" EnableNavigation="true"
                                EnableMonthYearFastNavigation="false" OnSelectionChanged="RadCalendar2_SelectionChanged">
                            </telerik:RadCalendar>
                        </div>
                        <telerik:RadPanelBar runat="server"  ID="PanelBar" Width="100%">
                            <Items>
                              <%--  <telerik:RadPanelItem runat="server" Text="My Team Calendars" Expanded="true">
                                    <Items>
                                        <telerik:RadPanelItem runat="server">
                                            <ItemTemplate>
                                                <div class="rpCheckBoxPanel">
                                                    <div>
    <asp:CheckBox ID="chkDevelopment" runat="server" Text="Development" Checked="true"
    AutoPostBack="true" OnCheckedChanged="CheckBoxes_CheckedChanged" />
                                                    </div>
                                                    <div>
    <asp:CheckBox ID="chkMarketing" runat="server" Text="Marketing" Checked="true" AutoPostBack="true"
    OnCheckedChanged="CheckBoxes_CheckedChanged" />
                                                    </div>
                                                </div>
                                            </ItemTemplate>
                                        </telerik:RadPanelItem>
                                    </Items>
                                </telerik:RadPanelItem>--%>
                              <%--  <telerik:RadPanelItem runat="server" Text="My Calendar" Expanded="true">
                                    <Items>
                                        <telerik:RadPanelItem runat="server">
                                            <ItemTemplate>
                                                <div class="rpCheckBoxPanel">
                                                    <div>
    <asp:CheckBox ID="chkQ1" runat="server" Text="Personal" Checked="true" AutoPostBack="true"
    OnCheckedChanged="CheckBoxes_CheckedChanged" />
                                                    </div>
                                                    <div>
    <asp:CheckBox ID="chkQ2" runat="server" Text="Work" Checked="true" AutoPostBack="true"
    OnCheckedChanged="CheckBoxes_CheckedChanged" />
                                                    </div>
                                                </div>
                                            </ItemTemplate>
                                        </telerik:RadPanelItem>
                                    </Items>
                                </telerik:RadPanelItem>--%>
                            </Items>
                        </telerik:RadPanelBar>
                    </telerik:RadPane>
                    
                  
                    <telerik:RadSplitBar runat="server" ID="RadSplitBar2" CollapseMode="Forward" />
                    <telerik:RadPane runat="Server" ID="rightPane" Scrolling="None" Width="625px">
                  <asp:UpdatePanel ID="updsch" runat="server" UpdateMode="Conditional" >
                  <ContentTemplate>
                         <telerik:RadScheduler  runat="server" ID="RadScheduler1" AllowEdit="false" AllowInsert="false" AllowDelete="false"
                            Height="551px" ShowFooter="false" OnClientTimeSlotClick="AppointmentInserting"
                            SelectedDate="2009-02-02" TimeZoneOffset="03:00:00"
                            DayStartTime="08:00:00" DayEndTime="21:00:00"                        
                            FirstDayOfWeek="Monday" LastDayOfWeek="Friday"
                            EnableDescriptionField="true"
                            AppointmentStyleMode="Default"
                            OnClientAppointmentDoubleClick="OnClientAppointmentDoubleClick"
                            OnNavigationComplete="RadScheduler1_NavigationComplete"
                        
                            OnAppointmentDataBound="RadScheduler1_AppointmentDataBound"
                            OnAppointmentDelete="RadScheduler1_AppointmentDelete"
                            OnAppointmentUpdate="RadScheduler1_AppointmentUpdate" >
                            <AdvancedForm Modal="true" />
                            <TimelineView UserSelectable="false" />
                                <AppointmentTemplate>
                                <div class="rsAptSubject">
                                    <%# Eval("Subject") %>
                                </div>
                               <%-- <%# Eval("Description") %>--%>
                            </AppointmentTemplate>
             <%--<TimeSlotContextMenuSettings EnableDefault="true" />
             <AppointmentContextMenuSettings EnableDefault="true" /> --%>
                        </telerik:RadScheduler>
                        </ContentTemplate>
                     
                      </asp:UpdatePanel>
                    </telerik:RadPane>
                </telerik:RadSplitter>
               
            </div>
            </div>
              <div id="AddEvent" style="display:none;width:100%;">
             <br /> <br /> <br /> <br />
           <table>
           <tr>
           <td class="style1">
           </td>
           <td><table>
              <tr>
              <td>
                  <asp:Label ID="lblName" runat="server" Text="Event Name"></asp:Label>
              </td>
              <td>
                  <asp:TextBox ID="txtName" runat="server"></asp:TextBox>
              </td>
              </tr>
              <tr>
              <td>
                  <asp:Label ID="lblDate" runat="server" Text="Date and Time"></asp:Label>
              </td>
              <td>
                  <%--<asp:TextBox ID="txtDate" runat="server"></asp:TextBox>--%>
                <%--  <telerik:raddatetimepicker ID="txtDate1" DateInput-DateFormat="dd/MM/yyyy HH:mm" DateDisplayFormat="dd/MM/yyyy HH:mm"
                      runat="server"></telerik:raddatetimepicker>--%>
                 
                  <telerik:raddatetimepicker runat="server" ID="txtDate1" ></telerik:raddatetimepicker>
                 <%-- <cc1:DateTimePicker ID="txtDate1"  runat="server"></cc1:DateTimePicker>--%>
              </td>
              </tr>
                 <tr>
              <td>
                  <asp:Label ID="lblVanue" runat="server" Text="Venue"></asp:Label>
              </td>
              <td>
                  <asp:TextBox ID="txtVanue" TextMode="MultiLine" runat="server"></asp:TextBox>
              </td>
              </tr>
              <tr>
              <td>
                  <asp:Label ID="lblDesc" runat="server" Text="Description"></asp:Label>
              </td>
              <td>
                  <asp:TextBox ID="txtDescription" TextMode="MultiLine" runat="server"></asp:TextBox>
              </td>
              </tr>
               <tr>
              <td>
                  <asp:Label ID="lblType" runat="server" Text="Event Type"></asp:Label>
              </td>
              <td>
                  <asp:DropDownList ID="ddlType" runat="server">
                  </asp:DropDownList>
                  
              </td>
              </tr>
              <tr>
              <td>
                  <asp:Label ID="lblLink" runat="server" Text="Event Link"></asp:Label>
              </td>
              <td>
                  <asp:TextBox ID="txtLink"  runat="server"></asp:TextBox>
              </td>
              </tr>
              <tr>
              <td>
              </td>
              <td>
                  <asp:Button ID="btnSave" runat="server" Text="Save" onclick="btnSave_Click" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<asp:Button
                      ID="btnCancel" runat="server" Text="Cancel" onclick="btnCancel_Click" />
              </td>
              </tr>
              </table>
           </td>
           </tr>
           </table>
              
              
              </div>
            <div id="List" style="display:none;">
            <table>
                 <tr>
              <td>
                  <asp:Label ID="lblFromDate" runat="server" Text="From Date"></asp:Label>
              </td>
              <td>
                  <asp:TextBox ID="txtFrom" runat="server"></asp:TextBox>
                
              </td>
               <td>
                  <asp:Label ID="lblToDate" runat="server" Text="To Date"></asp:Label>
              </td>
              <td>
                  <asp:TextBox ID="txtToDate" runat="server"></asp:TextBox>
           
              </td>
              </tr>
              <tr>
              <td>
                  <asp:Label ID="lblEveName" runat="server" Text="Event Name"></asp:Label>
              </td>
              <td>
                  <asp:TextBox ID="txtEventName" runat="server"></asp:TextBox>
                   
              </td>
              <td>
                  <asp:Label ID="lblUser1" runat="server" Text="User"></asp:Label>
              </td>
              <td>
                 
                  <asp:DropDownList ID="ddlUser1" runat="server">
                  </asp:DropDownList>
              </td>
              </tr>
              <tr>
              <td>
                  <asp:Button ID="btnDelete" runat="server" Text="Delete"
                      onclick="btnDelete_Click" />
              </td>
              <td></td>
              <td>
               <asp:Button ID="btnshow1" runat="server" Text="Show" />
              </td>
              <td>
                <asp:Button ID="btnAdd" runat="server" Text="Add Event" onclick="btnAdd_Click" />
              </td>
              </tr>
            </table>
              <%--  <asp:GridView ID="grdList" runat="server" DataKeyNames="ID" AutoGenerateColumns="false" AllowPaging="true" AllowSorting="true" >
                <Columns>
                <asp:CheckBoxField  />
                <asp:BoundField DataField="" HeaderText="Event"  />
                 <asp:BoundField DataField="" HeaderText="Vanue"  />
                  <asp:BoundField DataField="" HeaderText="Date"  />
                   <asp:BoundField DataField="" HeaderText="Rating"  />
                   <asp:TemplateField HeaderText="Edit" >
                   <EditItemTemplate >
                   </EditItemTemplate>
                   </asp:TemplateField>
                </Columns>
                </asp:GridView>--%>
            </div>
        
       -------------------------------------------------------------------------------
    but problem is this usercontrol works fine in my local aspx file
    but when i publish it to sharepoint the telerik script is not registed so in one of ur blog as below url
    http://www.telerik.com/community/forums/aspnet-ajax/scheduler/asp-updatepanel-and-radscheduler-issues.aspx
    you said to register it in prerender ,....I followed it but still same error i.e.
    Could not find UpdatePanel with ID XXXXXX. If it is being updated dynamically then it must be inside another UpdatePanel
    so i cant change dates as well day,week,month views....................
    plsssssssssssssssssssss reply sooooooooooon...............
  4. Helen
    Admin
    Helen avatar
    1052 posts

    Posted 27 Apr 2011 Link to this post

    Hello Alex,

    We tried to reproduce the problem in a web part based on your code, but without much success. We made many changes in order to run the code and couldn't be sure where the problem might be.

    Could you please open a support ticket and attach a running sample of your web part together with the code behind and any other resources that you use?

    Other than that we noticed that you didn't reference the Telerik.Web.UI.dll on the page with its fully qualified assembly name.

    Regards,
    Helen
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Back to Top