Okay, going to try and describe this as clearly as possible, since it's a bit of a complicated situation.
This is for VS2010, .NET 4.0, Telerik Q1-2010 release.
The setup is as follows, there's a master page, with a content page. The master page has an ajaxmanager and the content page has a proxyajaxmanager. The content page has user controls, amongst other things.
The goal is as follows: there's a linkbutton on the content page, that when clicked adds a user control to a panel on the content page.
The problem: the linkbuttons are dynamically added, as in:
var li = new LinkButton |
{ |
Text = action.Name, |
ToolTip = action.Description, |
ID = "al" + action.ReportActionTypeID, |
EnableViewState = false |
}; |
li.Click += ActionTrigger; |
ActionPanel.Controls.Add(li); |
So, after that, I attempt to add them to the Ajaxmanager from code behind (doing it through longer way of constructing and using Add instead of AddSetting, because AddSetting was throwing a null reference error that I never managed to figure out):
var ajaxSetting = new AjaxSetting(); |
var target = new AjaxUpdatedControl(ActionPanelDynamic.ID, "AjaxLoadingPanel"); |
ajaxSetting.UpdatedControls.Add(target); |
ajaxSetting.AjaxControlID = li.ID; |
_ajaxManager.AjaxSettings.Add(ajaxSetting); |
The code executes with no issues, however, the AJAX is not applied as expected. It just does a full page refresh when one of the linked buttons is clicked.
I've tried to apply settings to a static linkbutton (one that I just added in markup), and this functions as expected.
My guess at this point is that the IDs of controls are just incorrect at some point? As ASP renames them, and there are some empty string warnings for GetElementByID in FireBug console. But I'm not really sure at what point or where to correct this. I was thinking this http://west-wind.com/weblog/posts/54760.aspx may possibly be related?