Hi,
I'm struggling to get a consistent way of Ajaxifying my controls and I'm wondering if there's an approach you can recommend for me. Here's my setup:
I have a Master page with code:
I've then got a web content page that uses a series of user controls in the aspx such as:
I have a button that I want to do an Ajax postback and update these user control textboxes. I have the following code on the page load of my content page:
I've had this working before by wrapping the address details area in a RadAjaxPanel but since I read your article at http://www.telerik.com/help/aspnet-ajax/ajxcontrolsinajaxpanelandajaxsettings.html I removed the AjaxPanels. Now though I have the following problems:
1) The loading image in the LoadingPanel is not displaying.
2) The controls aren't updating properly. There seems to be a copy of the controls that are going to be updating being spawned.
When I did have the RadAjaxPanel on the page the behaviour seemed to work better but I want to hear your suggestions on how to make this work consistently every time.
Thanks in advance,
Rick
I'm struggling to get a consistent way of Ajaxifying my controls and I'm wondering if there's an approach you can recommend for me. Here's my setup:
I have a Master page with code:
| protected override void OnInit(EventArgs e) |
| { |
| base.OnInit(e); |
| _radAjaxManager = new RadAjaxManager(); |
| _radAjaxManager.ID = "radAjaxManager"; |
| _radAjaxManager.UpdatePanelsRenderMode = UpdatePanelRenderMode.Inline; |
| form1.Controls.Add(_radAjaxManager); |
| _radAjaxLoadingPanel = new RadAjaxLoadingPanel(); |
| _radAjaxLoadingPanel.ID = "radAjaxLoadingPanel"; |
| _radAjaxLoadingPanel.BackgroundPosition = AjaxLoadingPanelBackgroundPosition.Center; |
| _radAjaxLoadingPanel.Transparency = 20; |
| _radAjaxLoadingPanel.BackColor = Color.WhiteSmoke; |
| //_radAjaxLoadingPanel.BackImageUrl = "/Images/ajax-loader.gif"; |
| Image img = new Image(); |
| img.ImageUrl = "/Images/ajax-loader.gif"; |
| _radAjaxLoadingPanel.Controls.Add(img); |
| form1.Controls.Add(_radAjaxLoadingPanel); |
| } |
| public void AjaxifyControl(Control ajaxifiedControl, Control updatedControl) |
| { |
| radAjaxManager.AjaxSettings.AddAjaxSetting(ajaxifiedControl, updatedControl, radAjaxLoadingPanel); |
| } |
I've then got a web content page that uses a series of user controls in the aspx such as:
| <uc:WinTextBox ID="txtAddress1" Name="Address1" runat="server" Required="true" TabIndex="33" /> |
| <uc:WinTextBox ID="txtAddress2" Name="Address2" runat="server" Required="true" TabIndex="34"/> |
I have a button that I want to do an Ajax postback and update these user control textboxes. I have the following code on the page load of my content page:
| Master.AjaxifyControl(btnFindMyAddress, txtAddress1); |
| Master.AjaxifyControl(btnFindMyAddress, txtAddress2); |
I've had this working before by wrapping the address details area in a RadAjaxPanel but since I read your article at http://www.telerik.com/help/aspnet-ajax/ajxcontrolsinajaxpanelandajaxsettings.html I removed the AjaxPanels. Now though I have the following problems:
1) The loading image in the LoadingPanel is not displaying.
2) The controls aren't updating properly. There seems to be a copy of the controls that are going to be updating being spawned.
When I did have the RadAjaxPanel on the page the behaviour seemed to work better but I want to hear your suggestions on how to make this work consistently every time.
Thanks in advance,
Rick