Tooltip Not Updating?

2 posts, 0 answers
  1. Landon Martin
    Landon Martin avatar
    6 posts
    Member since:
    Oct 2009

    Posted 17 Nov 2009 Link to this post

    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.  
            } 
  2. Landon Martin
    Landon Martin avatar
    6 posts
    Member since:
    Oct 2009

    Posted 17 Nov 2009 Link to this post

    Ugh. I need to not give up so easily.
    I changed my UserControl code... before in SetIndex I was updating the controls.  What I changed it to is I store the information and then in the user control's PreRender event THEN I actually set the control values.  It works fine now.  Thanks anyway!
Back to Top