Results 1 to 7 of 7

Thread: what's a literalControl?

  1. #1

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    Talking what's a literalControl?

    stupid question, can someone tell me?
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  2. #2
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    The literal control renders static text. for example:

    Code:
       <b>The literal control spit me out!</b>

  3. #3
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    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>");

  4. #4

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    umm thanks, second day working with asp.net 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
    I dont understand why they used literalcontrol. They are just adding plain text (no formatting, no html tags) to a tablecell

    VB Code:
    1. Dim cellFont As New TableCell
    2.             ' ff is just a fontFamily var
    3.             cellFont.Controls.Add(New LiteralControl(ff.Name))
    4.  
    5.  
    6.             ' why dont they use this instead?
    7.             ' cellFont.Text = ff.Name

    what's the point of a literal control there?
    Last edited by MrPolite; Jul 7th, 2003 at 04:41 PM.
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  5. #5
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    Remeber that we are working in an object oriented environment, and it is much cleaner using objects that simply using mass string concactenation.

  6. #6

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    hmmmmmmmmmmmmmmmmmmmmmm ok
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  7. #7
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width