Click here to Skip to main content
15,894,646 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, I am new at ASP.Net and I am wondering why we use literal. I read some documents and they say that literal's text value can be changed programatically but we can change a label's text property programatically too...

Like Label1.Text="anything";

So can you please explain me briefly, why and when we should use the literal control?

Thank you very much in advance.
Posted

Hi Arun ,

Go through the below thread
Here[^]

Thanks
--RA
 
Share this answer
 
The Label Control is used to place text which can be static or assigned, for which you can provide style by setting properties regarding its look which is unable for Literal Control.

But in Literal Control you can include the HTML code,in which you can explore its style .

The Literal control is used to display text; that is, it renders static text on a Web page without adding additional HTML tags. It passes content directly to the client browser unless you use the Mode property to encode the content.

It can be used to control the page title or button labels if requirement is dynamic.

This link demonstrates with illustration, check
http://www.techrepublic.com/blog/programming-and-development/use-aspnets-literal-control-to-its-full-potential/618[^]
 
Share this answer
 
Comments
Arunprasath Natarajan 28-Jan-13 9:22am    
Tan q Madam

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900