I've created an .aspx page that consists of many custom .ascx controls and I'd like to create a page function that generates a tool tip for each control. I've created an interface that each .ascx control implements to create the tool tip (the function is called GetToolTipInfo(), so all I need now is a way to reference the .ascx control dynamically by it's ID.
Here is the function I'm currently trying to use...
Protected Sub SetToolTip(sender As Object, args As ToolTipUpdateEventArgs)
Dim control As New Literal()
Dim info As ToolTipInfo = CType(Me.FindControl(args.TargetControlID).Parent, FormFunction).GetToolTipInfo()
control.Text = info.content
RadToolTipManagerMain.Width = info.width
RadToolTipManagerMain.Position = info.position
args.UpdatePanel.ContentTemplateContainer.Controls.Clear()
args.UpdatePanel.ContentTemplateContainer.Controls.Add(control)
End Sub
As it is, FindControl returns nothing. I could hard code each control reference into this function, but wondered if there was a more elegant way. I am also using a Master page and a Content panel if that has anything to do with it.
Thank you for any suggestions.