Google Brother Up

2009/02/03

Difference between a Label and a Literal in ASP.NET

1. Label is heavy weight so increases size of page while literal is light weight, so decreases size of page.
2. Label supports cssclass property but literal does not support cssclass property.
3. Label cannot be used to insert html code directly but literal can be used to insert html code directly so dynamically html tags can be created.
4. When AssociatedControl property is set, Label produces an html label as its output but when AssociatedProperty is omittedm then Label text will be wrapped in a span.

For more help refer: http://forums.asp.net/t/710459.aspx

177 unique visitors

No comments:

Drop Down List

1. http://www.janetsystems.co.uk/Articles/NetArticles/tabid/74/itemid/161/modid/449/Default.aspx