Product Review with html

Dec 8, 2010 at 6:24 PM

How can you display Product Review comments in the ListView when they include html markup?

The AjaxControlToolkit HTMLEditor on the AddReview page enables a comment to be "marked up" with style data which gets saved to the database.  That "marked up" comment then does not display correctly in the ListView of the ProductDetails page.  Instead it just displays a cell with both the text content and the mark up like so:

<span style="font-weight: bold">This product </span><span style="background-color: #ffff00; font-style: italic; font-family: georgia,times new roman,times,serif; font-size: 24pt; text-decoration: underline">rocks</span>




Dec 8, 2010 at 10:13 PM

I suppose you could turn off request validation and just use the html, but you really shouldn't let untrusted users input markup.

Dec 9, 2010 at 2:20 PM
Edited Dec 9, 2010 at 5:41 PM

Yes, I would think you don't want the editor to allow any html.  Only way I could find is to use something like this: 

which will strip away the tags from the UserComment.Content in the ReviewAddBtn_Click event before the db.SaveChanges()


 I added the following css and set the editor css to = CustomEditorStyle.  it has NO effect in this application ... but it works if I clone it in a different  web application.   Why?

Border-Width: thick;

.CustomEditorStyle .ajax__htmleditor_editor_toptoolbar {

.CustomEditorStyle .ajax__htmleditor_editor_bottomtoolbar {










Dec 13, 2010 at 12:24 PM

It works once I cleared the browser cache.