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

MasterPage And AjaxManager

2 Answers 183 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Aurelio Righetti
Top achievements
Rank 1
Aurelio Righetti asked on 18 Mar 2010, 10:30 PM
Hi all,
i have a problem with MasterPage and AjaxManager, this trivial example works with VS2008 but con VS2010 framework 4.0 reports an error and
I can not use the RadAjaxManager with the setting in a MasterPage.
PS) This sample is in a Help CHM: MasterPages: ajaxify and update controls in master and content page.
With Framework 3.5 work fine (Telerik Version 2010.1.309.35  RunTime:v2.0.50727)

Master Page:
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="MasterPage.master.cs" Inherits="RadControlsWebApp1.MasterPage" %> 
 
<!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"
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server"
        <Scripts> 
            <%--Needed for JavaScript IntelliSense in VS2010--%> 
            <%--For VS2008 replace RadScriptManager with ScriptManager--%> 
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" /> 
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" /> 
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" /> 
        </Scripts> 
    </telerik:RadScriptManager> 
    <script type="text/javascript"
        //Put your Java Script code here. 
    </script> 
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"
        <AjaxSettings> 
            <telerik:AjaxSetting AjaxControlID="btnDecrease"
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="TextBox1" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
        </AjaxSettings> 
         
    </telerik:RadAjaxManager> 
  
    <telerik:RadSkinManager ID="RadSkinManager1" Runat="server" Skin="Office2007"
    </telerik:RadSkinManager> 
    <div> 
    <asp:LinkButton ID="btnDecrease" runat="server" OnClick="btnDecrease_Click">Decrease</asp:LinkButton> 
<asp:TextBox ID="TextBox1" runat="server">0</asp:TextBox> 
 
        <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server"
         
        </asp:ContentPlaceHolder> 
    </div> 
    </form> 
</body> 
</html> 

ContentPage:
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.Master" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="RadControlsWebApp1.WebForm1" %> 
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"
</asp:Content> 
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"
</asp:Content> 

This is the Javascript error:

  'get_postBackElement().id' è nullo o non è un oggetto  Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=RadScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d4.0.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3ait-IT%3a00000000-0000-0000-0000-000000000000%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%3ait-IT%3aa491094c-5dfe-45a9-a72f-e5f5f0640d11%3a16e4e7cd%3af7645509%3a22a6274a%3aed16cbdc, Riga 1054 Carattere 1

If I hide hte AjaxSetting it works but is obviously made the postback the entire page:
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="MasterPage.master.cs" Inherits="RadControlsWebApp1.MasterPage" %> 
 
<!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"
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server"
        <Scripts> 
            <%--Needed for JavaScript IntelliSense in VS2010--%> 
            <%--For VS2008 replace RadScriptManager with ScriptManager--%> 
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" /> 
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" /> 
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" /> 
        </Scripts> 
    </telerik:RadScriptManager> 
    <script type="text/javascript"
        //Put your Java Script code here. 
    </script> 
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"
         
    </telerik:RadAjaxManager> 
  
    <telerik:RadSkinManager ID="RadSkinManager1" Runat="server" Skin="Office2007"
    </telerik:RadSkinManager> 
    <div> 
    <asp:LinkButton ID="btnDecrease" runat="server" OnClick="btnDecrease_Click">Decrease</asp:LinkButton> 
<asp:TextBox ID="TextBox1" runat="server">0</asp:TextBox> 
 
        <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server"
         
        </asp:ContentPlaceHolder> 
    </div> 
    </form> 
</body> 
</html> 

I use the versione of ASP.NET AJAX 2010 Q1 2010.1.309.40 RunTime:v4.0.30128
Tnks Aurelio

2 Answers, 1 is accepted

Sort by
0
Pavel
Telerik team
answered on 19 Mar 2010, 08:45 AM
Hello Aurelio,

The problem is related to a bug in the 4.0 version of the .Net Framework which prevents RadAjaxManager from working properly in Master/Content page scenarios. To workaround it you can set ClientIDMode of the page to "AutoID". You can also read the following blog post for more details about this.

I can also inform you that the issue in the Framework is fixed by Microsoft and RadAjaxManager will work for the final release of VS2010 and .Net 4.0 in such a scenario.

Sincerely yours,
Pavel
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Aurelio Righetti
Top achievements
Rank 1
answered on 19 Mar 2010, 03:26 PM
Hello Pavel
Thanks for the elucidation using in the web.config <pages clientIDMode="AutoID"> it work fine, I read the postblog it is very interesting but quite complex to understand for me:) ..

Tnks
Aurelio
Tags
Ajax
Asked by
Aurelio Righetti
Top achievements
Rank 1
Answers by
Pavel
Telerik team
Aurelio Righetti
Top achievements
Rank 1
Share this question
or