stupid question, can someone tell me? :)
Printable View
stupid question, can someone tell me? :)
The literal control renders static text. for example:
Code:<b>The literal control spit me out!</b>
To go a little further, you can include html tags in the text so they will format the text when displayed.
LiteralControl lc = new LiteralControl("<b>This is going to show up bold</b>");
umm thanks, second day working with asp.net:D still confused about a lot of stuff, hehe
edit: aah
I've got this stupid book, too easy, read 130 pages of it in a day:D
I dont understand why they used literalcontrol. They are just adding plain text (no formatting, no html tags) to a tablecell
VB Code:
Dim cellFont As New TableCell ' ff is just a fontFamily var cellFont.Controls.Add(New LiteralControl(ff.Name)) ' why dont they use this instead? ' cellFont.Text = ff.Name
what's the point of a literal control there?:rolleyes:
Remeber that we are working in an object oriented environment, and it is much cleaner using objects that simply using mass string concactenation.
hmmmmmmmmmmmmmmmmmmmmmm ok :p
To answer your question, I don't think their example needed the literal control at all. But there are a lot of other uses for it.