With the following code:
Dim x As System.Xml.Linq.XElement = _
<div>
<%= message.ToString() %>
</div>
Dim m = x.ToString()
…if message is HTML, then the < and > characters get converted to < and &rt;.
How can I force it to skip this encoding?
What is the type of your
messagevariable? Ifmessageis anXElement, then just leave off the.ToStringcall like this:If
messageis some other type (likeStringBuilder), then do this: