locked
freetextbox is postback or refreshed with asp.net timer RRS feed

  • Question

  • User-418973555 posted

    have wrapped up the freetextbox editor inside updatepanel but it still keep refreshing maybe caused by timer tick,

    tried enablepartialrendering="true" inside script manager wont make difference

      <asp:Timer ID="FieldTimer2" runat="server" Interval="1000" OnTick="FieldTimer2_Tick" />
              </ContentTemplate>
            <Triggers>
              <asp:AsyncPostBackTrigger ControlID="FieldTimer2" EventName="Tick" />
            </Triggers>
            </asp:UpdatePanel>
    ...
     <asp:UpdatePanel ID="udpfreetextbox" runat="server">
            <ContentTemplate>
              <FTB:FreeTextBox id="FreeTextBox1" runat="Server"  />
              </ContentTemplate>
           
          </asp:UpdatePanel>

    Thursday, June 20, 2019 3:26 AM

All replies

  • User-719153870 posted

    Hi larnvok09,

    According to your description, we can assume that the problem occurs on three controls: timer, update panel and freetextbox.

    You can test these three parts with the following code:

    <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering = "true"></asp:ScriptManager>
                <asp:UpdatePanel ID="UpdatePanel1" runat="server" ChildrenAsTriggers="true" UpdateMode="Conditional">
                    <ContentTemplate>
                        <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
                        <asp:Timer ID="FieldTimer2" runat="server" Interval="1000" OnTick="FieldTimer2_Tick" />
                        <%= DateTime.Now.ToLongTimeString() %>
                    </ContentTemplate>
                </asp:UpdatePanel>
    
                <asp:UpdatePanel ID="udpfreetextbox" runat="server" ChildrenAsTriggers="true" UpdateMode="Conditional">
                    <ContentTemplate>
                        <%= DateTime.Now.ToLongTimeString() %>
                        <FTB:FreeTextBox ID="FreeTextBox1" runat="server"></FTB:FreeTextBox>
                        <asp:TextBox ID="TextBox1" runat="server" Width="500px" Height="200px"></asp:TextBox>
                        <ajaxToolkit:HtmlEditorExtender ID="HtmlEditorExtender1" runat="server" TargetControlID="TextBox1" EnableSanitization="false"></ajaxToolkit:HtmlEditorExtender>
                    </ContentTemplate>
                </asp:UpdatePanel>

    The result of this demo:

    We can find that the ‘current time’ in the same UpdatePanel with timer is dynamic, while the’ current time’ in another UpdatePanel is fixed. This means that your problem does not appear on the update panel or timer.

    As long as I know, FreeTextBox may not work with update panel. You can also see the HtmlEditorExtenderI added below works well, I recommend that you can use HtmlEditorExtender.

    For questions about freetextbox, you can ask the third party concerned.

    Best Regards,

    Yang Shen

    Thursday, June 20, 2019 9:37 AM