RadAjaxManager does not work in some browsers

2 posts, 0 answers
  1. Denisas
    Denisas avatar
    9 posts
    Member since:
    Apr 2010

    Posted 09 Feb 2012 Link to this post

    I've noteced, that RadAjaxManager works only in Google Chrome, Mozilla Firefox 7.0.1, but does not work neither in IE9, nor in Safari or may be even more browser.
    I'd like to ask, if there is any work around or this control is not designed to support popular browsers. Or is there any mistakes in my code.

    I have a Master page, Web user control and Web form page. Here is the code to reproduce bug.

    Master page
    <%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site.master.cs" Inherits="RAM.Site" %>
    <%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
    <%@ Register src="WebUserControl.ascx" tagname="WebUserControl" tagprefix="uc" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     
    <head runat="server">
        <title></title>
        <asp:ContentPlaceHolder ID="head" runat="server">
        </asp:ContentPlaceHolder>
    </head>
    <body>
        <form id="form1" runat="server">
            <div>
                <telerik:RadScriptManager ID="RadScriptManager1" Runat="server">  
                    <Scripts>
                        <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>
                <telerik:RadAjaxManager runat="server" ID="RadAjaxManager" onajaxrequest="RadAjaxManager_AjaxRequest">
                    <AjaxSettings>
                        <telerik:AjaxSetting>
                        </telerik:AjaxSetting>
                    </AjaxSettings>       
                </telerik:RadAjaxManager>
                <asp:UpdatePanel ID="UpdatePanel" runat="server" UpdateMode="Conditional">
                    <ContentTemplate>               
                        <uc:WebUserControl ID="WebUserControl1" runat="server" />               
                    </ContentTemplate>
                </asp:UpdatePanel>
                <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">       
                </asp:ContentPlaceHolder>
            </div>
            <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
                <script type="text/javascript">
     
                    function doAjaxRequest() {
                        $find("<%= RadAjaxManager.ClientID %>").ajaxRequest("AddNumber");
                        var UpdatePanel = '<%= UpdatePanel.ClientID %>';
                        __doPostBack(UpdatePanel, '');
                        return false;
                    }
     
                </script>
            </telerik:RadCodeBlock>  
        </form>
    </body>
    </html>

    Master page code:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
     
    namespace RAM
    {
        public partial class Site : System.Web.UI.MasterPage
        {
            private int _number;
            public int Number
            {
                get
                {
                    if (Session["Number"] != null)
                        _number = (int)Session["Number"];
                    else _number = 0;
                    return _number;
                }
                set
                {
                    Session["Number"] = value;
                }
            }
     
            protected void Page_PreRender(object sender, EventArgs e)
            {
                Session["Number"] = Number;           
            }
     
            protected void Page_Load(object sender, EventArgs e)
            {
                  
            }
     
            protected void RadAjaxManager_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e)
            {
                if (e.Argument.StartsWith("Add"))
                {
                    Number++;
                }
            }
        }
    }

    Web User Control:
    <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="WebUserControl.ascx.cs" Inherits="RAM.WebUserControl" %>
    <asp:Label ID="Label" runat="server" Text="---"></asp:Label>

    Web User Control code:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
     
    namespace RAM
    {
        public partial class WebUserControl : System.Web.UI.UserControl
        {
            protected void Page_Load(object sender, EventArgs e)
            {
                this.Label.Text = (Page.Master as Site).Number.ToString();
            }
        }
    }

    Web Form:
    <%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="WebForm.aspx.cs" Inherits="RAM.WebForm" %>
    <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    </asp:Content>
    <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
        <asp:Button ID="Button" runat="server" Text="Increase number" OnClientClick="doAjaxRequest(); return false;" />
    </asp:Content>


  2. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 14 Feb 2012 Link to this post

    Hi Denisas,

    I tested the provided code on my side but was not able to observe any problematic behaviour related to the RadAjaxManager in the mentioned browsers.
    Find attached the sample application, test it on your side and let me know what the difference in your case is.


    All the best,
    Maria Ilieva
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Back to Top