How can I handle an ampersand (“&”) character in a Telerik HTML textbox?
While rendering, it’s giving me an error. Also, does anybody know about any other character that may cause errors in an HTML textbox?
How can I handle an ampersand (&) character in a Telerik HTML textbox? While
Share
Ampersand is a special character in HTML that specifies the start of an escape sequence (so you can do something like
©to get a copyright symbol, etc.). If you want to display an ampersand you have to escape it. So if you replace all ampersands with&, that should take care of the error.However, if there were ampersands in your input that were already escaped – like maybe your data had
©– you wouldn’t want to escape that ampersand. But if your data won’t have any of these ampersands, a simple replace should be fine.You also need to replace greater than and less than symbols (> and <) with
>and<respectively.Telerik talks about these limitations/issues on this page http://www.telerik.com/help/reporting/report-items-html-text-box.html