Window Modal Popup is closed after a PostBack !

3 posts, 0 answers
  1. Mrwell
    Mrwell avatar
    5 posts
    Member since:
    Feb 2018

    Posted 11 Mar Link to this post

     

    I have RadWindow popup all things working on it fine just I faced  with a problem is that the RadWindow after PostBack  the RadWindow is closed immediately ..! I mean this event OnSelectedIndexChanged="ddltype_SelectedIndexChanged" has fired however I putted UpdatePanel  in side  

     

    <p><telerik:RadWindow ID="RadWindow1" runat="server" Modal="true" Behaviors="Close">                                       <br> </p><p><ContentTemplate></p><p><strong>the UpdatePanel  goes here</strong></p><p></ContentTemplate></p><p></telerik:RadWindow ></p>

     but I getting this error mesasage

    Cannot unregister UpdatePanel with ID '' since it was not registered with the ScriptManager. This might occur if the UpdatePanel was removed from the control tree and later added again, which is not supported. Parameter name: updatePanel

    what is wrong with the code thanks in advance

    Entire code

     

    <p><telerik:RadWindowManager ID="RadWindowManager1" runat="server" Width="400" Height="200"><br>              <br><br>                <Windows><br><br>                    <telerik:RadWindow ID="RadWindow1" runat="server" Modal="true" Behaviors="Close"><br>                       <br>                        <br>                        <ContentTemplate><br><br>                  <br> <br>                                   <br><br><br>                 <asp:DropDownList ID="ddltype" runat="server" OnSelectedIndexChanged="ddltype_SelectedIndexChanged" DataSourceID="sdsCalFeulTypesNew" AutoPostBack="true" DataTextField="CalFeulTypeName" DataValueField="CalFeulTypeId"><br><br>                     <asp:ListItem Selected="True">Select ...</asp:ListItem><br><br><br><br>                 </asp:DropDownList><br><br><br><br><br>                                        <asp:SqlDataSource ID="sdsCalFeulTypesNew" runat="server"<br>                                            ConnectionString="<%$ ConnectionStrings:Myconnectionstring %>"<br>                                            SelectCommandType="StoredProcedure" SelectCommand="SPCommandName"><br><br>                                            <SelectParameters><br><br><br>                                                <asp:Parameter Name="FeulCatFkey" Type="Int32" DefaultValue="1" /><br><br><br>                                            </SelectParameters><br><br>                                        </asp:SqlDataSource><br><br><br><br><br><br><br>                                        <telerik:RadAutoCompleteBox ID="RadAutoCompleteBox1" CssClass="racSlide" Style="padding: 5px; margin: 5px; width: 70%;" Font-Bold="true"<br>                                            TextSettings-SelectionMode="Single" runat="server" DropDownWidth="240px"<br>                                            InputType="Text" DataSourceID="sdsCalculationName" DataTextField="CalculationName" DataValueField="Calculation_ID"<br>                                            EmptyMessage="Search Items" MinFilterLength="2" MaxResultCount="10" AllowTokenEditing="true"<br>                                            EnableClientFiltering="false" AllowCustomEntry="true"<br>                                            AutoPostBack="false" EnableAjaxSkinRendering="False" EnableTextSelection="True"<br>                                            EnableAriaSupport="True" Filter="StartsWith"><br>                                        </telerik:RadAutoCompleteBox><br><br><br><br><br><br><br><br><br>                                    <div style="margin-top: 60px; margin-left: 10px;"><br><br><br><br>                                        <asp:Button runat="server" ID="btnCancel" CssClass="btn btn-danger" Text="Cancel" Style="margin-top: 5px;" /><br><br><br><br>                                        <asp:Button runat="server" ID="btnNewCalculation" CssClass="btn btn-info" OnClick="btnNewCalculation_Click" Text="Start Calculation" Style="margin-top: 5px;" ValidationGroup="VGCal" /><br><br><br>                                    </div><br><br><br><br><br>                                    <asp:SqlDataSource ID="sdsCalculationName" runat="server"<br>                                        ConnectionString="<%$ ConnectionStrings:Myconnectionstring %>"<br>                                        SelectCommandType="StoredProcedure" SelectCommand="spCommandName"><br>                                        <SelectParameters><br><br><br>                                            <asp:Parameter Name="dep" Type="int16" DefaultValue="1" /><br><br>                                        </SelectParameters><br>                                    </asp:SqlDataSource><br>                        <br><br>                             <br><br><br><br><br>                        </ContentTemplate><br><br>                                 <br>                    </telerik:RadWindow><br><br>    </Windows><br><br>               <br><br><br> <br>            <br>            </telerik:RadWindowManager></p><p></p>

     

     

     

  2. Mrwell
    Mrwell avatar
    5 posts
    Member since:
    Feb 2018

    Posted 11 Mar in reply to Mrwell Link to this post

    The code

    <telerik:radwindowmanager id="RadWindowManager1" runat="server" width="400" height="200">
                   
     
                    <Windows>
     
                        <telerik:RadWindow ID="RadWindow1" runat="server" Modal="true" Behaviors="Close" visibleonpageload="true">
                            
                              
                            <ContentTemplate>
                                   
     
                                    
                      <style>
                          html .racSlide .RadAutoCompleteBoxPopup {
                              font-size: 13px;
                              font-weight: bold;
                          }
                      </style>
     
                                        <label>
                                            Type:
     
     
     
                     <asp:DropDownList ID="ddltype" runat="server" OnSelectedIndexChanged="ddltype_SelectedIndexChanged" DataSourceID="sdsCalFeulTypesNew" AutoPostBack="true" DataTextField="CalFeulTypeName" DataValueField="CalFeulTypeId">
     
                         <asp:ListItem Selected="True">Select ...</asp:ListItem>
     
     
     
     
                     </asp:DropDownList>
     
     
     
     
                                            <asp:SqlDataSource ID="sdsCalFeulTypesNew" runat="server"
                                                ConnectionString="<%$ ConnectionStrings:Connstr %>"
                                                SelectCommandType="StoredProcedure" SelectCommand="spGetAllCalType">
     
                                                <SelectParameters>
     
     
                                                    <asp:Parameter Name="FeulCatFkey" Type="Int32" DefaultValue="1" />
     
     
                                                </SelectParameters>
     
                                            </asp:SqlDataSource>
     
     
     
     
     
     
                                            <telerik:RadAutoCompleteBox ID="RadAutoCompleteBox1" CssClass="racSlide" Style="padding: 5px; margin: 5px; width: 70%;" Font-Bold="true"
                                                TextSettings-SelectionMode="Single" runat="server" DropDownWidth="240px"
                                                InputType="Text" DataSourceID="sdsCalculationName" DataTextField="CalculationName" DataValueField="Calculation_ID"
                                                EmptyMessage="Search Items" MinFilterLength="2" MaxResultCount="10" AllowTokenEditing="true"
                                                EnableClientFiltering="false" AllowCustomEntry="true"
                                                AutoPostBack="false" EnableAjaxSkinRendering="False" EnableTextSelection="True"
                                                EnableAriaSupport="True" Filter="StartsWith">
                                            </telerik:RadAutoCompleteBox>
     
     
     
     
     
                                        </label>
     
     
     
     
     
                                        <div style="margin-top: 60px; margin-left: 10px;">
                                              
                                            <asp:Button runat="server" ID="btnCancel" CssClass="btn btn-danger" Text="Cancel" Style="margin-top: 5px;" />
                                              
                                            <asp:Button runat="server" ID="btnNewCalculation" CssClass="btn btn-info" OnClick="btnNewCalculation_Click" Text="Start Calculation" Style="margin-top: 5px;" ValidationGroup="VGCal" />
     
     
                                        </div>
     
                                  
                                        <asp:SqlDataSource ID="sdsCalculationName" runat="server"
                                            ConnectionString="<%$ ConnectionStrings:Connstr %>"
                                            SelectCommandType="StoredProcedure" SelectCommand="spGetAllCalculationName">
                                            <SelectParameters>
     
     
                                                <asp:Parameter Name="dep" Type="int16" DefaultValue="1" />
     
                                            </SelectParameters>
                                        </asp:SqlDataSource>
                              
                            </ContentTemplate>
     
                                      
                        </telerik:RadWindow>
     
        </Windows>
  3. Missing user
    Missing user avatar

    Posted 13 Mar Link to this post

    Hi,

    The error message you are experiencing occurs due to the limitation of the RadWindowManager. This is also mentioned in the Cannot unregister UpdatePanel with ID 'UpdatePanelID' since it was not registered with the ScriptManager error.

    There are two options for you to handle this problem.

    Option 1

    Mark-up

    <telerik:RadWindow ID="RadWindow1" runat="server" Modal="true">
        <ContentTemplate>
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>
                    <telerik:RadButton runat="server" ID="RadButton3" OnClick="RadButton3_Click"
                        Text="Postback" AutoPostBack="true" />
                    <telerik:RadLabel runat="server" ID="RadLabel1"></telerik:RadLabel>
                </ContentTemplate>
            </asp:UpdatePanel>
        </ContentTemplate>
    </telerik:RadWindow>

    JavaScript

    function onClientClicked(sender, args) {
        var wndw = $find("<%= RadWindow1.ClientID %>");
        wndw.show();
    }

     

    Option 2

    Mark-up

    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadButton3">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadLabel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
        <Windows>
            <telerik:RadWindow ID="RadWindow1" runat="server" Modal="true">
                <ContentTemplate>
                    <telerik:RadButton runat="server" ID="RadButton3" OnClick="RadButton3_Click"
                        Text="Postback" AutoPostBack="true" />
                    <telerik:RadLabel runat="server" ID="RadLabel1"></telerik:RadLabel>
                </ContentTemplate>
            </telerik:RadWindow>
        </Windows>
    </telerik:RadWindowManager>

    JavaScript for the button to open the window

    function onClientClicked(sender, args) {
        var wndw = $find("<%= RadWindow1.ClientID %>");
        wndw.show();
    }

    Server-side code to update the label

    protected void RadButton3_Click(object sender, EventArgs e)
    {
        RadLabel1.Text = DateTime.Now.TimeOfDay.ToString();
    }

    Regards,
    Doncho
    Progress Telerik

    Get quickly onboarded and successful with UI for ASP.NET AJAX with the Virtual Classroom technical trainings, available to all active customers. Learn More.
Back to Top