We have a service that generates a report (using word templates and a 3rd party library), and then returns a string in HTML. While this HTML isn’t great – its formatted correctly in this string.
We want this HTML to show up on a page – format intact. What we currently have done is set an ASP.net Literal’s text element to this string.
While this works, I have noticed that it has reformatted the HTML string slightly. For the most part, it looks like it generated a bunch of new CSS classes, and a new style element in the HTML. This HTML does not exist in the string thats being returned. I could filter all of this back out, but wonder if there is a better way.
I assume that the Page itself is altering something.
What is the best way to display this raw HTML back to the user? I can’t directly use a Response.Write(string), because this page does have a few other controls on it.
Literal controls do not format their text values (AFAIK), so I would guess it’s something else. Possibly a response filter (Request.Filter) which could be altering the page output? Another possbility may be that a containing control might be altering the value of its child controls (i.e. your literal) in it’s custom rendering.