Hey there!
As I'm from Germany, please excuse some Errors in your wonderful language :-)
I have the following problem:
I'm in train to ajaxify a fairly complex project with a masterpage and several stacked UserControls.
For this purpose and the Idea to ajaxify specific Controls through the code, I programmed a codepiece to add AjaxSettings to the AjaxManager on the MasterPage and find the given Controls automatically.
This is working good now except that the most important feature is missing: I find the Control's UniqueIDs, the LoadingPanel is displayed properly and at the right place, but the updated Control is not being updated at all.
If I add the AjaxSettings manually in the ASPX-Page, the Update (e.g. updating DateTime.Now) works fine - using the same UniqueIDs that are calculated in my Function SearchControl as follows.
In the following Codeblock, the CodeBehind-File of the Masterpage is shown, in which the functions are executed.
Can you explain, why this function produces a working Site with working LoadingPanels but without a working UpdatedControl?
Thanks so much in advance,
sincerely yours,
Felix
As I'm from Germany, please excuse some Errors in your wonderful language :-)
I have the following problem:
I'm in train to ajaxify a fairly complex project with a masterpage and several stacked UserControls.
For this purpose and the Idea to ajaxify specific Controls through the code, I programmed a codepiece to add AjaxSettings to the AjaxManager on the MasterPage and find the given Controls automatically.
This is working good now except that the most important feature is missing: I find the Control's UniqueIDs, the LoadingPanel is displayed properly and at the right place, but the updated Control is not being updated at all.
If I add the AjaxSettings manually in the ASPX-Page, the Update (e.g. updating DateTime.Now) works fine - using the same UniqueIDs that are calculated in my Function SearchControl as follows.
In the following Codeblock, the CodeBehind-File of the Masterpage is shown, in which the functions are executed.
Can you explain, why this function produces a working Site with working LoadingPanels but without a working UpdatedControl?
Thanks so much in advance,
sincerely yours,
Felix
| protected void Page_Load(object sender, EventArgs e) | |
| { | |
| AddAjaxSettings(this.Page, "Button1", "TimeLabel", "RadAjaxLoadingPanel1"); | |
| } | |
| protected void AddAjaxSettings(Control parent, string InitiateControl, string UpdatedControl, string LoadingPanel) | |
| { | |
| InitiateControl = SearchControl(parent, InitiateControl); | |
| UpdatedControl = SearchControl(parent, UpdatedControl); | |
| LoadingPanel = SearchControl(parent, LoadingPanel); | |
| AjaxSetting AS1 = new AjaxSetting(InitiateControl); | |
| AS1.UpdatedControls.Add(new AjaxUpdatedControl(UpdatedControl, LoadingPanel)); | |
| RadAjaxManager.GetCurrent(Page).AjaxSettings.Add(AS1); | |
| } | |
| protected string SearchControl(Control parent, string ControlToSearch) | |
| { | |
| string output = ""; | |
| if (parent.HasControls()) | |
| { | |
| foreach (Control c in parent.Controls) | |
| { | |
| if (c.UniqueID.ToString().EndsWith(ControlToSearch) == true) | |
| { | |
| output = c.UniqueID; | |
| break; | |
| } | |
| else | |
| { | |
| output = SearchControl(c, ControlToSearch); | |
| if (output != "") break; | |
| } | |
| } | |
| return output; | |
| } | |
| else return output; | |
| } |