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

Showing RadEditor content in Tooltip

2 Answers 89 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Zaly
Top achievements
Rank 1
Zaly asked on 06 Sep 2015, 12:25 AM

Hi,

 

I saved the content of RadEditor to a database. The saved content includes all the HTML mark-ups (e.g. <​strong>Company</strong>).

The question is when I retrieved the content from the database and bind to a label's tooltip, it shows the mark-up (e.g. <​strong>Company</strong>) instead of the formatted output (i.e. "Company" as a bold text).

What is the correct way of showing the tooltip with formatted content from RadEditor?

 

Zaly

2 Answers, 1 is accepted

Sort by
0
Accepted
Marin Bratanov
Telerik team
answered on 08 Sep 2015, 08:45 AM

Hi Zaly,

How exactly do you assign the HTML content to the tooltip? If you bind it to the title attribute of an HTML element (its ToolTip server property), the framework will HTML encode your content (I am attaching a screenshot) and the browser will not render the HTML, but if you pass it directly to the RadToolTip control, you should not have issues.

Here are a few examples:

with the Text property

RadToolTip1.Text="<strong>bold text</strong>";

with a control in its tags

<telerik:RadToolTip ID="RadToolTip1" runat="server" VisibleOnPageLoad="true">
    <div runat="server" id="content"></div>
</telerik:RadToolTip>
content.InnerHtml="<strong>bold text</strong>";

with a target that has HTML in its title attribute (based on the screenshot)

<asp:Label ID="Label1" Text="label for textbox" AssociatedControlID="Textbox1" runat="server" />
<asp:TextBox ID="Textbox1" runat="server" />
<telerik:RadToolTip ID="RadToolTip1" runat="server" TargetControlID="Label1"></telerik:RadToolTip>
Label1.ToolTip="<strong>bold text</strong>";

Regards,

Marin Bratanov
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Zaly
Top achievements
Rank 1
answered on 14 Sep 2015, 03:26 AM

Hi Marin,

Thanks for the answer. Your solution works.

Regards,

Zaly

Tags
Editor
Asked by
Zaly
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Zaly
Top achievements
Rank 1
Share this question
or