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

Escaped Ampersand causes An error has occurred while processing HtmlTextbox

2 Answers 274 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jono
Top achievements
Rank 1
Jono asked on 25 Aug 2015, 12:52 AM

I have escaped the ampersand but still get this error

the unit.Description is "something something & something something"

I then run the following code;

var unit = HttpUtility.HtmlEncode(unit.Description);

which returns "something something & something something"

this is bound to a field in a HtmlTextBox

Provider: {=Fields.Description.ToUpper()} ({=Fields.Identifier})

which causes (see the attachment)

when I manually remove the ampersand the report renders just fine

I have read other threads on this suggesting to escape it but this is not working. Any ideas?

Telerik Version : Q2 2013 7.1.13.705

 

 

 

 

 

2 Answers, 1 is accepted

Sort by
0
Jono
Top achievements
Rank 1
answered on 25 Aug 2015, 12:55 AM

in the code above it may appear I didn't bind the correct field but I am. The code of course is

unit.Description = HttpUtility.HtmlEncode(unit.Description); 

 

 

0
Jono
Top achievements
Rank 1
answered on 25 Aug 2015, 02:44 AM

got it!

 

it was the .ToUpper() that changed & to & and which the htmltextbox could not parse....

 

hope this helps someone

Tags
General Discussions
Asked by
Jono
Top achievements
Rank 1
Answers by
Jono
Top achievements
Rank 1
Share this question
or