posted 7/6/2009 7:11:13 AM by Vijendra Shakya
Literal Control: It is used to display data; it is lightweight and does not make any formatting techniques. Literal control will render only its text which is assigned in its text property. For example:
<div>
<asp: Literal ID="Literal1" runat="server" Text="This is a literal control">
</asp: Literal>
</div> this code render as: <div> This is a literal control</div>
Label Control: It is also used for display data, it makes formatting techniques when it render. It will render text within span tag. For example:
<asp: Label ID="Literal1" runat="server" Text="This is a label control">
</asp: Label>
</div> this code render as: <div><span>This is a label control </span></div>
Vijendra Shakya (Member since: 11/29/2008 6:26:22 AM) Nothing special to share with you.
View Vijendra Shakya 's profile
Thanks heaps.. I was confused before as to why some ppl use one and some the other
Leave a comment
It's fast, easy and free! Submit articles, get your own blog, ask questions & give answers in the forums, and become a better developer, faster.
enter your email address: