This is a migrated thread and some comments may be shown as answers.

I have a legacy application that dynamically writes HTML into literals...

2 Answers 26 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Rex
Top achievements
Rank 1
Rex asked on 18 Oct 2012, 09:40 PM
I render about 60 images on a page as:

string _html = String.Emtpy;

_html += "<img javascript:void() style=\"z-index: 100; position: absolute; left: " + _releaseLeft + "px; top: " + _imageTop.ToString(CultureInfo.InvariantCulture) + "px;\" src=\"/Images/Orange.png\" /><div style=\"z-index: 101; position: absolute; color: white; top: " + _versionTextTop + "px; left: " + _textLeft + "px; float: right\" id=\"buttonText\">" + pVersionNumber + "</div>" + "\r\n";

PageHTML.Text = _html;

The above code is a switch that adds 4 different images but each image has unique values associated with it.

How can I bind a tooltip in such a way that each image when it is hovered over displays the tooltip properly?

I need to display rich text like:

<strong>Firmware: </strong> yadda
<strong>Release Date: </strong> some date
<strong>More Info: </strong> embedded URL.
....
....
and so on...


2 Answers, 1 is accepted

Sort by
0
Rex
Top achievements
Rank 1
answered on 18 Oct 2012, 09:43 PM
I have reviewed the examples but cannot seem to find a straight forward one that doesn't use web services and a bunch of extra noise. I don't have a sufficient reason to add database calls or web services.
0
Marin Bratanov
Telerik team
answered on 22 Oct 2012, 11:04 AM
Hello Rex,

You can use the alt attribute of the images and the AutoTooltipify feature of RadToolTipManager:
http://demos.telerik.com/aspnet-ajax/tooltip/examples/autotooltipify/defaultcs.aspx

You can also try the approach from this demo: http://demos.telerik.com/aspnet-ajax/tooltip/examples/databasetooltipswithoutlod/defaultcs.aspx. Once you generate the Ids of the images you can add them as targets for the manager and add a specific HTML string for them. Note you may need to escape it to prevent it from breaking the page.

All the best,
Marin Bratanov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
ToolTip
Asked by
Rex
Top achievements
Rank 1
Answers by
Rex
Top achievements
Rank 1
Marin Bratanov
Telerik team
Share this question
or