Literal control - why?

V

VB Programmer

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.
 
K

Kevin Spencer

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.
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,


Usually I use a Literal to inject Javascript code to the client.

Cheers,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top