Ajax panel on master page

3 posts, 0 answers
  1. mansour
    mansour avatar
    31 posts
    Member since:
    Nov 2007

    Posted 29 Apr 2008 Link to this post

    Hello,
       I have an Ajax panel on  a master page. The problem is that every time that I try to update part of the master page, the whole page is updated and effectively Ajax panel doesn't work

    Any suggestion why it is happening and how I can solve it?

    Regards
  2. Todd Anglin
    Todd Anglin avatar
    2040 posts
    Member since:
    Aug 2005

    Posted 29 Apr 2008 Link to this post

    Mansour-

    Without seeing any code, it's hard to say what's happening, but it sounds like there could be a problem some JavaScript on your page. In general, the RadAjax tools have not problems working with MasterPages.

    For the best control of your Ajax, though, I'd suggest you convert your RadAjaxPanels to standard ASP.NET Panels and then use the RadAjaxManager to control all of your ajaxification. This great simplifies things in a MasterPage environment, because you can put a single RadAjaxManager on the MasterPage and then use RadAjaxManagerProxy controls on your content pages and UserControls.

    Hope this helps. If not, please provide some more details about your project along with some sample code and we'll see if we can figure this out in the forums.

    -Todd
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. mansour
    mansour avatar
    31 posts
    Member since:
    Nov 2007

    Posted 29 Apr 2008 Link to this post

    Thanks for your reply.

    here is the code:

    master page code

    <%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site1.master.cs" Inherits="testchart.Site1" %>

    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

    <!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>Untitled Page</title>

    </head>

    <body>

    <form id="form1" runat="server">

    <div>

    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" Height="200px" Width="300px">

    <asp:Timer ID="Timer1" runat="server" Interval="5000" OnTick="Timer1_Tick">

    </asp:Timer>

    <asp:Image ID="Image1" ImageUrl="~/status_ok.gif" Visible="false" runat="server" />

    </telerik:RadAjaxPanel>

    </div>

    <div>

    <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">

    </asp:ContentPlaceHolder>

    </div>

    </form>

    </body>

    </html>

    master page c# code:

    public partial class Site1 : System.Web.UI.MasterPage

    {

    protected void Page_Load(object sender, EventArgs e)

    {

    }

    protected void Timer1_Tick(object sender, EventArgs e)

    {

    int Counter;

    if (Session["Tick"] == null)

    {

    Counter = 0;

    }

    else

    {

    Counter = (int)Session["Tick"];

    }

    if (Counter > 5)

    {

    Image1.Visible = true;

    }

    else

    {

    Counter++;

    Session["Tick"] = Counter;

    }

     

    }

    }


    content page code

    <%@ Page Language="C#" AutoEventWireup="true" Codebehind="Default.aspx.cs" Inherits="testchart._Default" MasterPageFile="~/Site1.Master"%>

    <%@ Register Assembly="Telerik.Charting, Version=2.0.0.0, Culture=neutral, PublicKeyToken=d14f3dcc8e3e8763"

     

    Namespace="Telerik.Charting" TagPrefix="telerik" %>

    <%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"

     

    Namespace="System.Web.UI" TagPrefix="asp" %>

     

     

    <%@ Register Assembly="Telerik.Charting" Namespace="Telerik.Charting" TagPrefix="telerik" %>

    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

     

    <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

     

     

    <asp:ScriptManager ID="ScriptManager2" runat="server">

     

    </asp:ScriptManager>

     

    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" Height="427px" Width="589px" HorizontalAlign="NotSet">

     

    <div>

     

    <telerik:RadChart ID="RadChart1" runat='server' Skin="Office2007" CssClass="RadChart" Width="1000px" Height="800px" OnClick="RadChart1_Click">

     

    </telerik:RadChart>

     

    &nbsp;&nbsp;<br />

     

    <br />

     

    <asp:Button ID="Button1" runat="server" Height="24px" OnClick="Button1_Click" Text="1"

     

    Width="116px" />

     

    <asp:Button ID="Button2" runat="server" Height="24px" Text="2" Width="130px" /></div>

     

    </telerik:RadAjaxPanel>

     

     

    </asp:Content>


    It is very simple project and there is no JS code there.

    when running the application, you should see that the chart is steady ( not refreshing) but after some time, the image at the top appears but in fact you see that at each AJAX refresh, the chart is also refreshes.

    Any help is very appreciated

    Regards




Back to Top