![]() |
|
|
|
#1 |
|
What's the real advantage to using a literal control over a simple label?
What are the pros/cons/typical usages for the literal control? Thanks. VB Programmer |
|
|
|
|
#2 |
|
Posts: n/a
|
A label renders a <span> tag. It allows you to programmatically change the
display characteristics of some text you want to display. A LiteralControl renders exactly whatever static HTML you want it to. There is no general advantage of using one over the other. One may be more useful than another in certain circumstances. For example, if you want to display static text, and make no programmatic changes to it, you might want to use a LiteralControl. -- HTH, Kevin Spencer ..Net Developer Microsoft MVP Big things are made up of lots of little things. "VB Programmer" <I-Hate-> wrote in message news:ehe$... > What's the real advantage to using a literal control over a simple label? > What are the pros/cons/typical usages for the literal control? > > Thanks. > > Kevin Spencer |
|
|
|
#3 |
|
Posts: n/a
|
I think they only real difference is that it inherits from Control, not WebControl, so you can't apply a style to the text. It probably would be a bit faster to render in that aspect as well.
http://msdn.microsoft.com/library/de...classtopic.asp And you can't do this with a label control, in one line.. someControl.controls.add(new LiteralControl("any text I want rendered")) "VB Programmer" <I-Hate-> wrote in message news:ehe$... > What's the real advantage to using a literal control over a simple label? > What are the pros/cons/typical usages for the literal control? > > Thanks. > > Raterus |
|
|
|
#4 |
|
Posts: n/a
|
Hi,
Usually I use a Literal to inject Javascript code to the client. Cheers, -- Ignacio Machin, ignacio.machin AT dot.state.fl.us Florida Department Of Transportation "VB Programmer" <I-Hate-> wrote in message news:ehe$... > What's the real advantage to using a literal control over a simple label? > What are the pros/cons/typical usages for the literal control? > > Thanks. > > Ignacio Machin \( .NET/ C# MVP \) |
|
![]() |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to control the height of a Drop down control | Siri_y | Software | 1 | 05-17-2009 06:19 AM |
| Mind Control and CIA'S BOURNE IDENTITY PLOT | soleilmavis@gmail.com | DVD Video | 2 | 08-03-2007 09:54 PM |
| Ajax Atlas not working in User Control | faiq | Software | 0 | 09-16-2006 08:28 AM |
| Charter Communications -- mind control | Laura | DVD Video | 0 | 01-28-2006 03:14 AM |
| FS: JP1 cable to program your universial remote control, now youcan control anything you want! | Mike | DVD Video | 0 | 07-15-2005 02:46 AM |