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

Using RadAjaxManagerProxy on content page with multiple ContentPlaceHolders.

4 Answers 169 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Jim
Top achievements
Rank 1
Jim asked on 18 Aug 2008, 09:23 PM
This is purely my lack of understanding, but I everything I have read so far has not really clicked yet, so I thought I would just come out and ask.  As a simplified example I have a master page with a RadAjaxManager control and two ContentPlaceHolder area declared.  I have a content page that defines content for the two ContentPlaceHolders like so.

<asp:Content ID="Content4" ContentPlaceHolderID="ContentPlaceHolderMain" Runat="Server"
    <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server"
    </telerik:RadAjaxManagerProxy> 
    <asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" /> 
</asp:Content> 
 
<asp:Content ID="content5" ContentPlaceHolderID="ContentPlaceHolderRight" runat="server"
    <asp:TextBox ID="TextBox1" runat="server" Text="0"></asp:TextBox>     
</asp:Content> 

and a very simple iterate algorithm on click

 protected void Page_Load(object sender, EventArgs e) 
    { 
        this.RadAjaxManagerProxy1.AjaxSettings.AddAjaxSetting(Button1, TextBox1, null); 
    } 
 
    protected void Button1_Click(object sender, EventArgs e) 
    { 
        this.TextBox1.Text = (int.Parse(this.TextBox1.Text) + 1).ToString(); 
    } 


If I comment out the Page_Load contents.  the iterator works as expected with full page post backs.  However, with the AddAjaxSetting() method being called I always receive the exception Object reference not set to an instance of an object. on that line.  Button1 has a non null value, TextBox1 has a non null value, and RadAjaxManagerProxy1 has a non null value.  What is the piece I am missing here? 

Thanks for your time.


4 Answers, 1 is accepted

Sort by
0
Jim
Top achievements
Rank 1
answered on 18 Aug 2008, 09:43 PM
Playing with my simplified project some more I notice that if I remove the RadAjaxManager from the Master page, and replace the RadAjaxManagerProxy with a RadAjaxManager on my content page everything seems to work exactly as I would expect. 

I have also noticed that the 2 content panels are irrelevant to this issue.  placing the RadAjaxManagerProxy, Button, and Textbox in the same ContentPlaceHolder does not resolve the problem I am experiencing.

Am I missing something that hooks the RadAjaxManagerProxy in the content page to the RadAjaxManager in the master page?
0
Konstantin Petkov
Telerik team
answered on 19 Aug 2008, 06:15 AM
Hello Jim,

The proxy control is provided for design-time configuration only. So indeed, you should get the RadAjaxManager instance when you need client or server-side functionality like adding AJAX settings dynamically. You can read more about the proxy control in the docs here.

Best wishes,
Konstantin Petkov
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Jim
Top achievements
Rank 1
answered on 19 Aug 2008, 03:05 PM
Obviously I missed that info in the docs, thanks for spelling it out for me.  And thanks for putting together such a high caliber control suite, and supporting it so well.

0
Konstantin Petkov
Telerik team
answered on 20 Aug 2008, 06:16 AM
Hello Jim,

Thank you for the nice words, much appreciated! We just do our best to "deliver more than expected". ;)

Regards,
Konstantin Petkov
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Ajax
Asked by
Jim
Top achievements
Rank 1
Answers by
Jim
Top achievements
Rank 1
Konstantin Petkov
Telerik team
Share this question
or