Click here to Skip to main content
Sign Up to vote bad
good
See more: ControlsASP:NET
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 20 Dec '12 - 0:15


3 solutions

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[^]
  Permalink  
Comments
Arunprasath Natarajan - 28 Jan '13 - 9:22
Tan q Madam
Hi Arun ,
 
Go through the below thread
Here[^]
 
Thanks
--RA
  Permalink  

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

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 OriginalGriff 255
1 Mahesh Bailwal 230
2 Aarti Meswania 225
3 Ron Beyer 215
4 Rohan Leuva 198
0 Sergey Alexandrovich Kryukov 8,553
1 OriginalGriff 6,899
2 CPallini 3,648
3 Rohan Leuva 2,963
4 Maciej Los 2,308


Advertise | Privacy | Mobile
Web04 | 2.6.130516.1 | Last Updated 21 Jan 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid