Last post Sep 11, 2008 05:54 AM by cjmos
Sep 10, 2008 05:53 AM|cjmos|LINK
Dynamic Data FieldTemplate HtmlEncoding
Sep 10, 2008 07:20 AM|chenthil_it|LINK
I didn't get the meaning of encoded. But still you can use the simplest way of assigning the html text from database to a Textbox.text. It will be rendered properly as an HTML.
Sep 10, 2008 07:36 AM|TATWORTH|LINK
Can you insert the HTML into a table cell using the InnerHtml property?
Sep 10, 2008 09:03 AM|cjmos|LINK
This won't make any sense unless you know a bit about dynamic data sites.
In a dynamic data site, the framework loads up the FieldTemplates control for whatever type of data you're trying to display. In this case (this field is a string (varchar)) it's the Text.ascx FieldTemplate that gets used. Inside Text.ascx there is simply
a literal control to display the data. The problem that I'm having is that the data is being HTMLEncodedby the Dynamic Data Framework before it goes into the literal control. So for example <br /> is actually displayed on the screen rather than a line break. I'd
like to stop this happening as I want my line breaks.
Dynamic Data HTMLEncoding FieldTemplates
Sep 10, 2008 02:18 PM|marcind|LINK
Hi Chris, sorry for the confusion. Try binding the Label to the FieldValue property, instead of the FieldValueString property (which gets html encoded; we are looking at ways of overriding this behavior in the next version).
To others responding on this thread: please look at the forum a question was posted to as it usually provides the context for the answer that a user is looking for. In this case the question refered to the
Dynamic Data feature which is new in ASP.NET 3.5 SP1.
Sep 11, 2008 05:54 AM|cjmos|LINK
Excellent that did the trick, many thanks.