posted 7/6/2009 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>
Thanks heaps.. I was confused before as to why some ppl use one and some the other
What kind of email newsletter would you prefer to receive from CodeAsp.Net?18