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

3 posts, 0 answers
  1. Rex
    Rex avatar
    7 posts
    Member since:
    Sep 2012

    Posted 18 Oct 2012 Link to this post

    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. Rex
    Rex avatar
    7 posts
    Member since:
    Sep 2012

    Posted 18 Oct 2012 Link to this post

    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.
  3. DevCraft R3 2016 release webinar banner
  4. Marin Bratanov
    Marin Bratanov avatar
    3558 posts

    Posted 22 Oct 2012 Link to this post

    Hello Rex,

    You can use the alt attribute of the images and the AutoTooltipify feature of RadToolTipManager:

    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.
Back to Top