I have a tooltip manager on my page that has 2 dropdowns and a textbox on it. When the user clicks an edit button I display the tooltip and load the controls. This works great the first time the button is clicked. However if the user closes the tooltip and clicks a second edit button on the page the tooltip shows with the information from the original item. I have stepped through the code and it shows that the values of the controls are being set correctly all the way throughout. However it doesn't seem that the actual controls are being updated on the page. I would appreciate any help anyone could provide.
protected void OnAjaxUpdate(object sender, ToolTipUpdateEventArgs args) |
{ |
string[] values = args.Value.Split('|'); |
if (values.Length > 0) |
{ |
this.UpdateToolTip(values[0], args.UpdatePanel, int.Parse(values[1])); |
} |
} |
private void UpdateToolTip(string section, UpdatePanel update, int index) |
{ |
ToolTipContent ctl = (ToolTipContent)Page.LoadControl("tooltipcontent/" + section + ".ascx"); |
ctl.SetIndex(index); //This sets the values of the controls |
update.ContentTemplateContainer.Controls.Add(ctl); |
//At this point (and after) the controls look like they are set correctly in the code |
//it is only when the tooltip is loaded that it shows incorrectly. |
} |