2

This may be related to this question: What's the Literal control used for and what's the difference to the Label Control in asp.net?

The literal control also has three values for MODE properties: PassThrough, Encode,Transform.

The first two are understandable but what does the third value: Transform signify? What kind of Transformation is being applied here to the text ?

Community
  • 1
  • 1
D Simm
  • 130
  • 1
  • 1
  • 12
  • 1
    http://stackoverflow.com/questions/3673830/difference-between-modes-of-literal-control – g2000 Sep 17 '15 at 15:20

1 Answers1

2

When you have a question about something built into .NET, the place to check is MSDN. Here's the relevant documentation for the Mode property.

Here's what is says about transform.

Unsupported markup-language elements are removed from the contents of the control. If the Literal control is rendered on a browser that supports HTML or XHTML, the control's contents are not modified.

Also

If you specify Transform, the rendering behavior of the Text property depends on the type of markup being rendered. When the Literal control is rendered for a device or browser that supports HTML or XHTML, specifying Transform produces the same behavior as specifying PassThrough. All markup tags and elements for the Text property are rendered for the requesting browser.

mason
  • 31,774
  • 10
  • 77
  • 121
  • Any example for _Unsupported markup-language elements_ ? – Royi Namir Sep 17 '15 at 15:23
  • @RoyiNamir I have no idea. But does it really matter to you? What browser doesn't support HTML or XHTML? Probably some really old phones from before the iPhone days. Seems like a legacy thing to me. – mason Sep 17 '15 at 15:26
  • @Mason: Thanks. Can you please give any examples of : " Unsupported markup-language elements" ? – D Simm Sep 17 '15 at 15:40
  • @DSimm Read my previous comment. – mason Sep 17 '15 at 15:41
  • 1
    @Mason: I mean can you give me one example of an HTML tag? like is it any

    markup or is it any kind markup which fall in category of: " Unsupported markup-language elements" ?
    – D Simm Sep 17 '15 at 15:44
  • 1
    @DSimm When I said I don't know, I meant "I do not know". But like I said *does it matter*? Are you dealing with browsers that don't understand HTML or XHTML? – mason Sep 17 '15 at 15:45
  • @Mason: Got the point! So this mode property will automatically take care of any such markups whatever they are. Thank you for your answer and the MSDN Link – D Simm Sep 17 '15 at 15:48
  • @mason If you supply an answer so it is perfectly valid to ask :' "what you meant when you said..." If all you wanted is to supply quoted text then you should have provide a link and not an answer. – Royi Namir Sep 17 '15 at 16:22
  • @RoyiNamir Yes, it is valid to ask for more details. It's also valid to respond "I don't know". And no, link only answers are highly discouraged on Stack Overflow. My post answers the question, provides a link for additional detail, and provides a valuable lesson about looking up documentation. – mason Sep 17 '15 at 16:25
  • I meant the "does it really matter to you?" part. As of matter of fact it is :-) I was wondering what invalid tags you referenced :-) that's all. – Royi Namir Sep 17 '15 at 16:26
  • @RoyiNamir Do you deal with browsers in 2015 that don't understand HTML or XHTML? Probably not. In which case, it's a purely academic question, which is fine. But I can't answer that. – mason Sep 17 '15 at 16:29