Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

Need help creating a dynamic tooltip control with PopupControlExtender

$
0
0

I'm trying to create a generic "tooltip" control using the PopupControlExtender (PCE) and I've hit a wall.

I have a site in which I want to implement my own custom tool tip. I have a popup tool tip (PUTT) control. It contains the PCE and the panel that contains the controls to pop-up. As an interface to the control, I want to be able to pass in the TargetControlID as well as a couple of strings thereby making it generic.

I will also have my own user controls that will make use of the PUTT. For example, my own text box control that contains a label, a text box and tool-tip icon.

The idea is the put only one PUTT control on the page and a number of my custom controls. When the user clicks on the icon in one of the custom controls, I will dynamically (in javascript) associate the PUTT with that control and manually trigger the PCE to pop up (display). I will also dynamically set the tool-tip's text, etc. from within the javascript code.

Here's a rough sketch of what I have:

ASPX page

[PUTT]

[UCTextBox1]
[UCTextBox2]
[UCTextBox3]

PUTT Control

[Panel containing controls to display]

[PopupControlExtender]

Properties:

  • MyTargetControlID
  • String1
  • String2

UCTextBox Control

[Label] [TextBox] [ToolTipIcon]


I hope that's clear. So, the user clicks on the ToolTipIcon which causes a javascript function to fire. That Javascript function will:

  • set PUTT.MyTargetControlID to the UCTextBox.ID (to associate the PCE with this particular control)
  • set PUTT's String1 and String2 values.
  • manually trigger/fire the PUTT so that it displays the PCE's panel (i.e. the tool tip)

The wall I've hit is the Javascript part. I can't, for the life of me, figure out how to get and pass in the TargetControlID and how to manually trigger the PCE. (Javascript is not my area of expertise... to say the least).

Has anyone done anything like this, or perhaps can give me some hints, tips or tricks? Sorry for the long post, but in the past I've been slammed for not posting enough detail in my questions.

Thanks,

Carlo.


Viewing all articles
Browse latest Browse all 5678

Trending Articles