Content controls in RadNotification within RadAjaxPanel create full postback (no ajax)

2 posts, 0 answers
  1. Erik
    Erik avatar
    314 posts
    Member since:
    Feb 2008

    Posted 12 Apr 2014 Link to this post

    Hello,

    I've been searching for a while now, but I cant find out how I can make a RadNotification part of the RadAjaxPanel. In my scenario, the notification is shown, but when I click a button in the contentTemplate of the RadNotification, a full postback is created in stead of the partial one with the loadingPanel.

    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel_App" runat="server"></telerik:RadAjaxLoadingPanel>
    <telerik:RadAjaxPanel ID="RadAjaxPanel_App" LoadingPanelID="RadAjaxLoadingPanel_App" runat="server">
        <telerik:RadNotification ID="RadNotification_ExitWithoutSave" Position="Center" Width="350px" Height="160px" LoadContentOn="FirstShow" AutoCloseDelay="0" Title="Please Confirm" TitleIcon="~/style/img/help2_16.png" EnableRoundedCorners="true" Animation="Fade" ShowCloseButton="False" Overlay="True" Opacity="95" KeepOnMouseOver="False" runat="server" RenderMode="Auto">
            <ContentTemplate>
                <telerik:RadButton ID="rbt_Yes" Text="Yes" CommandName="Yes" ButtonType="StandardButton" width="100px" Font-Bold="true" Icon-PrimaryIconCssClass="rbOk" Icon-PrimaryIconTop="6px" runat="server" RenderMode="Auto" />
            </ContentTemplate>
        </telerik:RadNotification>
     
    ......


    Any ideas on this?

    Kind regards,

    Erik
  2. Misho
    Admin
    Misho avatar
    129 posts

    Posted 15 Apr 2014 Link to this post

    Hi,

    I would suggest you to replace the RadAjaxPanel with RadAjaxManager to avoid the dispose of the Button which is the AJAX initiator.
    I'm sending you a sample that is showing the approach:

    <asp:ScriptManager runat="server"></asp:ScriptManager>
           <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel_App" runat="server">
                   <asp:Label ID="Label2" runat="server" ForeColor="Red">Loading... </asp:Label>
           </telerik:RadAjaxLoadingPanel>
            <telerik:RadNotification ID="RadNotification_ExitWithoutSave" Position="Center" Width="350px" Height="160px" AutoCloseDelay="0" Title="Please Confirm" TitleIcon="~/style/img/help2_16.png" EnableRoundedCorners="true" Animation="Fade" ShowCloseButton="False" Overlay="True" Opacity="95" KeepOnMouseOver="False" runat="server" RenderMode="Auto" VisibleOnPageLoad="true">
            <ContentTemplate>
                <telerik:RadButton ID="rbt_Yes" Text="Yes" CommandName="Yes" ButtonType="StandardButton" width="100px" Font-Bold="true" Icon-PrimaryIconCssClass="rbOk" Icon-PrimaryIconTop="6px" runat="server" RenderMode="Auto" OnClick="rbt_Yes_Click" />
                <telerik:RadTextBox runat="server" ID="TextBox1"></telerik:RadTextBox>
            </ContentTemplate>
        </telerik:RadNotification>
              <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel_App">
                <AjaxSettings>
     
                    <telerik:AjaxSetting AjaxControlID="rbt_Yes" >
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="TextBox1" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                </AjaxSettings>
            </telerik:RadAjaxManager>
     
            <script runat="server">
                protected void rbt_Yes_Click(object sender, EventArgs e)
                {
                    System.Threading.Thread.Sleep(1000);
                    TextBox1.Text = DateTime.Now.ToString();
                }
            </script>

    The notification uses a RadXmlHttpPanel control internally to provide its callbacks so this does not play very well with partial postbacks because of the nature of the webform callbacks. You can check this help article for more details on the matter.

    I hope you will find this information helpful.

    Best Regards,
    Misho
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top