Refresh Page's Title from asp:Timer with RadAjaxManager and EnablePageHeadUpdate

9 posts, 0 answers
  1. OL
    OL avatar
    20 posts
    Member since:
    Jan 2010

    Posted 01 Oct 2010 Link to this post

    Hello,
    I'd like to refresh the page's title from an asp:Timer.
    I'm in a master/detail ASP.NET scenario.
    My Site.Master contains a telerik:RadAjaxManager (with the default EnableAJAX and EnablePageHeadUpdate set to "true"):
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" >
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="myTimer">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="label1" UpdatePanelRenderMode="Inline" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
    </telerik:RadAjaxManager>
    Here is my (simplified) Tick event:
    protected void myTimer_Tick(object sender, EventArgs e)
    {
        label1.Text = "ABC";
        titrePage.Text = "DEF";
    }

    Here is the way I made the title editable from code-behind:
    <head runat="server">
        <title id="titrePage" runat="server"></title>
    </head>

    The update of the label1 is OK, but the page's title isn't (note: the title *is* updated in a no-AJAX scenario).
    I tried a:
    <telerik:AjaxUpdatedControl ControlID="pageTitle" /> but it fails my entire page.
    Thanks for your help ;).
  2. OL
    OL avatar
    20 posts
    Member since:
    Jan 2010

    Posted 05 Oct 2010 Link to this post

    Hello,
    Any idea?
    Thank you in advance.
  3. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 06 Oct 2010 Link to this post

    Hello,

    From the provided code I noticed that you are trying to modify wrong page title ID. The ID is set to "titrePage" but in the tick event you set "titrePage".
    Please find attached project which works correctly on my side. Test it locally and let me know if it works for you also.


    Sincerely yours,
    Maria Ilieva
    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
  4. Cori
    Cori avatar
    562 posts
    Member since:
    Jul 2010

    Posted 06 Oct 2010 Link to this post

    Hello OL,

    You don't even need to set the title tag as a server control since their is already a property of the Page class called Title, which sets the title of the page.

    So you just need to do this:

    Page.Title = "Some Title";

    I hope that helps.
  5. OL
    OL avatar
    20 posts
    Member since:
    Jan 2010

    Posted 06 Oct 2010 Link to this post

    Sorry, there was just a copy/paste error on my post. I'm using the same control ID, no problem.

    Thank you for the sample project which works fine.
    The problem is that I'm not in an aspx page but in a masterpage and it seems to be different.

    I updated your project with my example (Default2.aspx + MasterPage.master).
    Here is the zip file : http://goo.gl/cLWh (the PIN is : 41986).
    I hope you can reproduce.

    Thanks.
  6. OL
    OL avatar
    20 posts
    Member since:
    Jan 2010

    Posted 06 Oct 2010 Link to this post

    @Cori :
    Same problem, it appears to only work in a page, not a masterpage.
  7. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 07 Oct 2010 Link to this post

    Hello,

    Please test the MasterPage scenario by using regular asp UpdatePanel instead of RadAjax and verify if this makes any difference.

    Regards,
    Maria Ilieva
    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
  8. OL
    OL avatar
    20 posts
    Member since:
    Jan 2010

    Posted 07 Oct 2010 Link to this post

    No change, same problem.
  9. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 07 Oct 2010 Link to this post

    Hello,

    After making some research it seems that the issue you are facing is actually generic Ajax problem and is not directly related to RadAjax. As our Ajax controls are built based on asp UpdatePanel they will behave the same way in this situation.

    Greetings,
    Maria Ilieva
    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
Back to Top