I am using RadToolTipManager control and displaying tooltip. Tooltip text i am reading from the database.
for normal text i am able to display tooltip with no problem, but in my text there are carriage return characters (like \n \r),
that causes problem and does not display and gives me error.
Please see code:
private void PopulateQuestion()
{
lblSectionName.Text =
this.Question.PageTitle;
divSection.Visible = (
this.Question.PageTitle != string.Empty);
lblQuestionSequence.Text =
"Q." + this.Question.Sequence.ToString() + " - ";
lblQuestionText.Text =
this.Question.QuestionText;
// Set help icon alt text
//imgHelp.AlternateText = this.Question.AdditionalContent;
//imgHelp.Attributes.Add("title", this.Question.AdditionalContent); // For FireFox
// string s = "Khwaja \n saiyed";
// string newstr = s.Replace("\n", "<br/>");
//this.RadToolTipManager1.TargetControls.Add(imgHelp.ClientID, s.ToString(), true);
this.RadToolTipManager1.TargetControls.Add(imgHelp.ClientID, this.Question.AdditionalContent.ToString(), true);
}
protected void RadToolTipManager1_AjaxUpdate(object sender, Telerik.Web.UI.ToolTipUpdateEventArgs e)
{
Label lblInsideToolTip = new Label();
lblInsideToolTip.Text = e.Value;
e.UpdatePanel.ContentTemplateContainer.Controls.Add(lblInsideToolTip);
}
I hope this makes sense to all of you.
Thanks
Khwaja