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

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

8 Answers 179 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
OL
Top achievements
Rank 1
OL asked on 01 Oct 2010, 09:22 AM
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 ;).

8 Answers, 1 is accepted

Sort by
0
OL
Top achievements
Rank 1
answered on 05 Oct 2010, 01:08 PM
Hello,
Any idea?
Thank you in advance.
0
Maria Ilieva
Telerik team
answered on 06 Oct 2010, 02:16 PM
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
0
Cori
Top achievements
Rank 2
answered on 06 Oct 2010, 02:20 PM
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.
0
OL
Top achievements
Rank 1
answered on 06 Oct 2010, 02:52 PM
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.
0
OL
Top achievements
Rank 1
answered on 06 Oct 2010, 03:02 PM
@Cori :
Same problem, it appears to only work in a page, not a masterpage.
0
Maria Ilieva
Telerik team
answered on 07 Oct 2010, 10:30 AM
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
0
OL
Top achievements
Rank 1
answered on 07 Oct 2010, 10:48 AM
No change, same problem.
0
Maria Ilieva
Telerik team
answered on 07 Oct 2010, 01:03 PM
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
Tags
Ajax
Asked by
OL
Top achievements
Rank 1
Answers by
OL
Top achievements
Rank 1
Maria Ilieva
Telerik team
Cori
Top achievements
Rank 2
Share this question
or