Click here to Skip to main content
11,433,352 members (60,780 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Controls ASP: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 1:15am
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Hi Arun ,

Go through the below thread
Here[^]

Thanks
--RA
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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 at 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)



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

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100