locked
Editor control inside UpdatePanel control - flickers (whole page postback) RRS feed

  • Question

  • User800549252 posted

    Hi all.    I have a simple webform with an Ajax Editor inside an UpdatePanel control.

    It still does a postback of the whole page.

    Googled about 200 entries and couldn't find a solution.

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="bbb.aspx.cs" Inherits="myAJAX.bbb" %>
    <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
    <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit.HTMLEditor" TagPrefix="cc1" %>
    <!DOCTYPE html>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">    <title></title>    </head>
    <body>
        <form id="form1" runat="server">
            <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></asp:ToolkitScriptManager>
            <div>
                <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                    <ContentTemplate>
                        <cc1:Editor ID="Editor1" runat="server" Height="250px" Width="400px" />
                        <br />  <b>Enter your Content</b>
                        <br />  <asp:Button ID="btnSubmit" runat="server" Text="submit" OnClick="btnSubmit_Click" />
                        <br />  <asp:Label ID="lblResult" runat="server" Text="__________"></asp:Label>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </div>
        </form> 
    </body>
    </html>
    

    Code behind :

            protected void btnSubmit_Click(object sender, EventArgs e)
            {   lblResult.Text = Editor1.Content.Trim();
                Editor1.Content = string.Empty;            }
    

    How can I avoid the full postback so the screen would not annoyingly flicker.

    Please help.       Thanks.

    Gadi

    Friday, August 21, 2015 5:33 AM

All replies

  • User1686483761 posted

    Hi gadibh53

    According to your description, I create a sample to reproduce your problem, but I find it will only refresh the content of updatepanel rather than the full page when I click the “Button1” button.

    <div>
                <asp:Label ID="Label2" runat="server" Text="Label"></asp:Label>
             <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="True">
             </asp:ScriptManager>
             <asp:UpdatePanel ID="UpdatePanel1" runat="server" ChildrenAsTriggers="true" UpdateMode="Always">
                 <ContentTemplate>
                     <asp:Label ID="Label1" runat="server" ></asp:Label>
                     <br />
                     <asp:Button ID="Button1" runat="server" OnClick="btnSubmit_Click" Text="Button" />
                 </ContentTemplate>
             </asp:UpdatePanel>        
            </div>

    So please check if the value of EnablePartialRendering property is true.

    Besides, you could refer to http://www.aspdotnet-suresh.com/2012/05/ajax-updapanel-control-with-triggers.html

    I hope it’s helpful to you.

    Best Regards

    cheng zhang

    Monday, August 24, 2015 1:35 AM