Lable and Literal in Asp.Net
- Label control can be styled i.e. its Font, Color, Font Size, etc. can be easily changed but Literal control cannot be styled as it does not use any HTML tag.
- Label control enables to display static text on the web page. while Literal control is used most frequently when adding content dynamically to the page.
- Label control does have a "cssclass" property while Literal does not have a "cssclass" property.
- By default Text property of Label contains "Label1" but the text property of Literal control does not contains any text means It’s blank.
- Label control is less lightweight compare to Literal control while Literal control is more lightweight compare to Label Control.
Moreover, It is better to use literal control rather than label control . Literal control is supposed to use because the page size will be less compared to label control.