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

Update Masterpage control from controlpage

2 Answers 96 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Quim
Top achievements
Rank 1
Quim asked on 27 Oct 2008, 08:01 PM
Hi

I have a MasterPage "MP1" with RadAjaxManager, a Label named "Login" and one ContentPage.
On Content page there is a "Page1" with RadProxyManager.
Page1 has RadSplitter and one RadPane with "Page2" inside.

Inside Page2 I call a pop-up Page3 and from this last page I need to change a Label that is in MasterPage.

From Page3 I, when I close it, I  can call a javascript function named "change_login" that is on Page1:

    <telerik:RadCodeBlock ID="RadCodeBlock0" runat="server">
        <script language="javascript" type="text/javascript">
         // Passa valores por Ajax
           function change_login(new_login){
                //alert("def5: " + new_login);
                $find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>").ajaxRequest("Login;" + new_login);
                return false;
            }
         </script>   
    </telerik:RadCodeBlock>

In MP1 I have AjaxRequest event:

Protected Sub RadAjaxManager1_AjaxRequest(ByVal sender As Object, ByVal e As Telerik.Web.UI.AjaxRequestEventArgs) Handles RadAjaxManager1.AjaxRequest
        Dim sarr() As String = Split(e.Argument.ToString, ";")
      
        If sarr(0) = "Login" Then
            Login.Text = "New Login"
        End If
 End Sub



However when I call this function I can only see a postback on ContentPage.
I have no configuration on RadProxyManager and in RadAjaxManager I have:

 <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"  OnAjaxRequest="RadAjaxManager1_AjaxRequest">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="ContentPlaceHolder1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="Login" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
 </telerik:RadAjaxManager>

Best regards

2 Answers, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 28 Oct 2008, 12:28 PM
Hi Quim,

Please review the following help topic, which elaborates on initiating requests from one ContentPlaceHolder and loading/updating controls in another. Test the provided approach and let us know if this helps.

Best wishes,
Maria Ilieva
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Quim
Top achievements
Rank 1
answered on 29 Oct 2008, 02:48 PM
Hi

I prefered to keep focus on AjaxRequestWithTarget. I used an insivible button in order to make Ajax Registration and I used this button event function to change MasterPage control. This way, my javascript only needs to use AjaxRequestWithTarget to use this button event.
Perhaps there are easiest ways to do it, but this one is working.

Regards
Tags
Ajax
Asked by
Quim
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Quim
Top achievements
Rank 1
Share this question
or