This is a migrated thread and some comments may be shown as answers.

RadPane and RadEditor Re-Load After AJAX Postback

1 Answer 100 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Andy
Top achievements
Rank 1
Andy asked on 21 Jan 2009, 07:38 PM
I'm having a problem occurring in three different parts of my web-application that seem to be caused by the RadPane and RadEditor controls being implemented using frames/iframes.

Scenario 1:
I have a simple page layout with header (a ribbon menu) and two columns underneath. The two columns are created using radpane/splitter/radpane, with a RadTree in the left pane and another web page showing in the right pane (via navigateurl).
Whenever, any AJAX postback occurs on the Tree or Menu, the right-hand radpane re-loads causing it to blank for several seconds.

Scenario 2:
A simple page layout created dynamically in code-behind that comprises 10 RadEditors interspersed with some literal controls. There is a SAVE button at the top of the page.
Whenever, the save button is clicked, all of the radeditors re-load, causing their content to vanish for several seconds and then re-appear again.

Scenario 3:
No RadControls involved here. Just a simple page with an IFRAME and a button. The button is wrapped in an updatepanel and when clicked, it just disables itself code-behind.
Whenever the button is clicked, the IFRAME re-loads.

In all of these scenarios, the controls that cause the postbacks are wrapped within UpdatePanels to (supposedly) prevent them from affecting any other parts of the page. Yet, in all cases the RadPane, RadEditor Content and IFRAME re-load.

Is this a known issue with these controls and IFRAMES in ASP.NET AJAX and is there any workaround?

1 Answer, 1 is accepted

Sort by
0
Paul
Telerik team
answered on 22 Jan 2009, 09:55 AM
Hi Andy,

I suppose you think that you are performing a postback, and not a callback in this case, because you can see the progress bar of the browser indicating some progress. This actually is caused by the fact that you load another page in the IFRAME and is browser behavior rather than something caused by any of our controls. You can test this with a page, as simple as the one below:

<body> 
    <form id="form1" runat="server"
        <asp:ScriptManager ID="ScriptManager1" runat="server" /> 
         
        <asp:UpdatePanel ID="UpdatePanel1" runat="server"
            <ContentTemplate> 
                <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" /> 
                 
                <iframe id="load" runat="server"  ></iframe>    
            </ContentTemplate> 
        </asp:UpdatePanel> 
    </form>     
</body> 

protected void Button1_Click(object sender, EventArgs e) 
    HtmlControl frame1 = (HtmlControl)this.FindControl("load"); 
    frame1.Attributes["src"] = "Default2.aspx";   

Please note that even though you see the progress bar, indicating  progress, you are actually performing a callback, not a postback. In case you try to update a control, which is not in the UpdatePanel, you will see that the control will not be updated. For example:
<asp:UpdatePanel ID="UpdatePanel1" runat="server"
    <ContentTemplate> 
        <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" /> 
         
        <iframe id="load" runat="server"  ></iframe>    
    </ContentTemplate> 
</asp:UpdatePanel> 
<asp:Label ID="Label1" runat="server"></asp:Label> 

protected void Button1_Click(object sender, EventArgs e) 
    HtmlControl frame1 = (HtmlControl)this.FindControl("load"); 
    frame1.Attributes["src"] = "Default2.aspx"
 
    Label1.Text = "Postback"

In case you execute that code, you will notice that the Label will not be updated. The progress bar in this case only shows that another page is being loaded.

Best wishes,
Paul
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
General Discussions
Asked by
Andy
Top achievements
Rank 1
Answers by
Paul
Telerik team
Share this question
or