I'm using a standard HTMLEditorExtender control (part of the ajax control toolkit). In the original pageLoad I populate it with html (including >p<, >br<, >strong< and >img< tags. It displays fine in the HTMLEditorExtender control. Then, when I do a async postback (through an updatepanel), all the >img< tags display as the actual html instead of displaying the image. All the other tags are still displaying correctly.
The markup of the HTMLEditorExtender control is as follows after the async postback: In the invisible textarea used to keep the encoded value of the html, all the tags displaying correctly are encoded normally (i.e. < and >), but the img tags omit the ampersand before the encoded value (i.e. lt; and gt;)
UPDATE: it works fine if I put this code in my pageLoad event, but I'm wary of what security implications this has?
if (IsPostBack)
{
txtBookingConfirmation.Text = Server.HtmlDecode(txtBookingConfirmation.Text);
}
Can anyone please tell me how to prevent the control from doing this?
Thanks in advance
This seems to be the only solution and has not given any problems yet.