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

Get htmltextbox error message/code

2 Answers 79 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Girard Loic
Top achievements
Rank 1
Girard Loic asked on 28 May 2010, 03:04 PM

Hi

Is there a way to get an error message(or code)  when the contents of a htmltextbox isn’t supported (eg: <TABLE> tag)?  

Many thanks

2 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 31 May 2010, 08:23 AM
Hi Girard Loic,

To check whether the HtmlTextBox would be able to handle the content you set to its value, you should use the IsValidXHTML method of the HtmlTextBox processing instance.
You can do that check either in the ItemDataBinding event of the item e.g.:

private void htmlTextBox1_ItemDataBinding(object sender, EventArgs e)
   {
       var box = (Processing.HtmlTextBox)sender;
       if (box.IsValidXhtml((string)row[0]))
       {
           box.Value = row[0];
       }
       else
       {
           box.Value = StrippedXhtml;
       }
   }

or directly in the HtmlTextBox expression e.g.:

"=Iif(ReportItem.IsValidXhtml('content_here'), 'true_part', 'false_part')"

Best wishes,
Peter
the Telerik team

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 Public Issue Tracking system and vote to affect the priority of the items.
0
Girard Loic
Top achievements
Rank 1
answered on 31 May 2010, 09:39 AM
thank you for your help but I have an issue with your response, I don't find IsValidXhtml method in vb.net with Telerik reporting 2010 Q1
Tags
General Discussions
Asked by
Girard Loic
Top achievements
Rank 1
Answers by
Peter
Telerik team
Girard Loic
Top achievements
Rank 1
Share this question
or