hello all,
sorry for the ignorance, the label control was displaying the html just fine all along.
I was having an issue with an ASPxMemo control..basically I have a html editor, a memo box and a label. There is also a button and on click I was having the memo and the label populated. The memo was to display the actual HTML and the label the rendered HTML content. I kept getting an error message like so
A potentially dangerous Request.Form value was detected from the client (ASPxMemo1="<h4>the</h4>
<p><sp...").
Description: Request Validation has detected a potentially dangerous client input value, and processing of the request has been aborted. This value may indicate an attempt to compromise the security of your application, such as a cross-site scripting attack. You can disable request validation by setting validateRequest=false in the Page directive or in the
configuration section. However, it is strongly recommended that your application explicitly check all inputs in this case.
Exception Details: System.Web.HttpRequestValidationException: A potentially dangerous Request.Form value was detected from the client (ASPxMemo1="<h4>the</h4>
<p><sp...").
Source Error:
[No relevant source lines]
|
and i was associating it to the label box not rendering the html correctly.
But what was going on was that the memo control sometimes throws the above error if you dont cast the html to string to display the actual markup.
ie.
ASPxMemo1.Text = ASPxHtmlEditor1.Html; <-- may throw the above error on certain instances
ASPxMemo1.Text = ASPxHtmlEditor1.Html.ToString(); <--- this fixes the above error (i think)
Thanks all.