I asked this before, and Telerik assured me RadAjaxManager works with container controls such as ASP:Panel. I wasted almost 2 development days trying to figure out why some of my controls were not doing Ajax calls. I did a simple test and found two things are broken with RadAjaxManager.
ASPX Page:
Code Behind:
In the above example, clicking either btnInside or btnOutside will do a regular postback instead of Ajax callback. However, if I change the order the ajax setting is added, btnOutside will do an Ajax callback but btnInside will still do a regular postback.
This is a very simple example, and I actually spent a very long time debugging my fairly complex page. Note that I have to set my AjaxSetting programmatically because of the structure of a BasePage and a BaseMasterPage in my web framework.
To recap:
1. RadAjaxManager does not work with container controls
2. The order AjaxSettings are added programmatically can break other AjaxSettings.
So now, how do I know what's the correct order AjaxSettings are supposed to be added? If I have a panel with 10 controls that will postback and update a label in another panel, do I have to create 10 different AjaxSettings to accomplish this?
ASPX Page:
| <telerik:RadScriptManager runat="server"> |
| </telerik:RadScriptManager> |
| <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> |
| </telerik:RadAjaxManager> |
| <asp:Button runat="server" ID="btnOutside" Text="Outside Panel" /> |
| <asp:Panel runat="server" ID="pnlOne"> |
| <asp:Button runat="server" ID="btnInside" Text="Inside Panel" /> |
| </asp:Panel> |
| <asp:Panel runat="server" ID="pnlTwo"> |
| <asp:Label runat="server" ID="lbl"></asp:Label> |
| </asp:Panel> |
Code Behind:
| Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load |
| Me.RadAjaxManager1.AjaxSettings.AddAjaxSetting(Me.pnlOne, Me.lbl) |
| Me.RadAjaxManager1.AjaxSettings.AddAjaxSetting(Me.btnOutside, Me.lbl) |
| End Sub |
| Private Sub btnInside_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnInside.Click |
| Me.lbl.Text = "btnInside" |
| End Sub |
| Private Sub btnOutside_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnOutside.Click |
| Me.lbl.Text = "btnOutside" |
| End Sub |
In the above example, clicking either btnInside or btnOutside will do a regular postback instead of Ajax callback. However, if I change the order the ajax setting is added, btnOutside will do an Ajax callback but btnInside will still do a regular postback.
| Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load |
| Me.RadAjaxManager1.AjaxSettings.AddAjaxSetting(Me.btnOutside, Me.lbl) |
| Me.RadAjaxManager1.AjaxSettings.AddAjaxSetting(Me.pnlOne, Me.lbl) |
| End Sub |
This is a very simple example, and I actually spent a very long time debugging my fairly complex page. Note that I have to set my AjaxSetting programmatically because of the structure of a BasePage and a BaseMasterPage in my web framework.
To recap:
1. RadAjaxManager does not work with container controls
2. The order AjaxSettings are added programmatically can break other AjaxSettings.
So now, how do I know what's the correct order AjaxSettings are supposed to be added? If I have a panel with 10 controls that will postback and update a label in another panel, do I have to create 10 different AjaxSettings to accomplish this?