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

Updated Controls Disappearing

1 Answer 148 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Kory
Top achievements
Rank 1
Kory asked on 28 Dec 2009, 09:16 PM
I have a Master Page with a RadAjaxManager. Then I have an ASPX Content Page with a RadAjaxManagerProxy. This page has a Panel control that contains a User Control. The User Control also has a RadAjaxManagerProxy.

I have the Panel on the aspx page as an updated control in the RadAjaxManagerProxy for a Button.

What happens is any updates in the ASCX Control cause the Updated Controls in its RadAjaxManagerProxy to disappear.

I have reproduced this with Firefox 3 and IE8.


Master Page:
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="123.master.cs" Inherits="_123" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"
<head runat="server"
    <title></title
    <asp:ContentPlaceHolder id="head" runat="server"
    </asp:ContentPlaceHolder> 
</head> 
<body> 
    <form id="form1" runat="server"
            <asp:ScriptManager ID="scriptmanager1" runat="server" /> 
      <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server"
                 
      </asp:ContentPlaceHolder> 
      <telerik:RadAjaxManager ID="AjaxManager1" runat="server" UpdatePanelsRenderMode="Inline"
      </telerik:RadAjaxManager> 
    </form> 
</body> 
</html> 

ASPX Page:
<%@ Page Title="" Language="C#" MasterPageFile="~/123.master" AutoEventWireup="true" CodeFile="123.aspx.cs" Inherits="_123" %> 
<%@ Register TagPrefix="uc" TagName="Test" Src="~/123.ascx" %> 
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server"
</asp:Content> 
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"
    <asp:Panel ID="pnl1" runat="server" style="width: 300px; height: 200px; border: solid 1px #000000"
        <uc:Test ID="test1" runat="server" /> 
    </asp:Panel> 
    <asp:Button ID="btn1" runat="server" Text="Submit" OnClick="btn1_Click" style="margin-top: 20px" /> 
    <telerik:RadAjaxManagerProxy ID="AjaxManagerProxy1" runat="server"
        <AjaxSettings> 
            <telerik:AjaxSetting AjaxControlID="btn1"
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="pnl1" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
        </AjaxSettings> 
    </telerik:RadAjaxManagerProxy> 
</asp:Content> 

ASPX Code Behind:
using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Web; 
using System.Web.UI; 
using System.Web.UI.WebControls; 
 
public partial class _123 : System.Web.UI.Page { 
 
  protected void Page_Load(object sender, EventArgs e) { 
         
  } 
 
    protected void btn1_Click(object sender, EventArgs e) { 
        pnl1.BackColor = System.Drawing.Color.Red; 
    } 
 

ASCX Page:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="123.ascx.cs" Inherits="_123" %> 
<asp:TextBox ID="txt1" runat="server" /> 
<asp:Button ID="btn1" runat="server" Text="Test" OnClick="btn1_Click" /> 
<telerik:RadAjaxManagerProxy ID="AjaxProxy1" runat="server"
    <AjaxSettings> 
        <telerik:AjaxSetting AjaxControlID="btn1"
            <UpdatedControls> 
                <telerik:AjaxUpdatedControl ControlID="txt1" /> 
            </UpdatedControls> 
        </telerik:AjaxSetting> 
    </AjaxSettings> 
</telerik:RadAjaxManagerProxy> 

ASCX Code Behind:
using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Web; 
using System.Web.UI; 
using System.Web.UI.WebControls; 
 
public partial class _123 : System.Web.UI.UserControl { 
 
  protected void Page_Load(object sender, EventArgs e) { 
         
  } 
 
    protected void btn1_Click(object sender, EventArgs e) { 
        txt1.Text = "Updated"
    } 
 



1 Answer, 1 is accepted

Sort by
0
Veli
Telerik team
answered on 30 Dec 2009, 09:49 AM
Hi Kory,

The reason for this behavior is that you have 2 update panels AJAX-ifying the same content - 1 on your content page and 1 on your user control they both AJAX-ify the textbox. This scenario is not supported in MS Ajax, i.e. you should not have 2 update panels asynchronously updating one and the same content of your page.

Greetings,
Veli
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Ajax
Asked by
Kory
Top achievements
Rank 1
Answers by
Veli
Telerik team
Share this question
or