System.Web.UI Namespace
Represents HTML elements, text, and any other strings in an ASP.NET page that do not require processing on the server.
Visibility |
Name |
Value Type |
Accessibility |
public |
Text
|
String |
[ Get , Set ] |
|
ASP.NET compiles all HTML elements and readable text that do not require server-side processing into instances of this class. For example, an HTML element that does not contain a runat="server" attribute/value pair in its opening tag is compiled into a LiteralControl object.
Literal controls behave as text holders, meaning that you can extract text from the literal control and remove the literal control from the parent server control's ControlCollection through the parent's Controls property. Therefore, when you develop a custom control derived from the LiteralControl class, make sure your control performs any required preprocessing steps itself, rather than using a call to the LiteralControl.Render method call to accomplish them. Typically you would do this to improve the response time of your Web application.
You can add or remove literal controls from a page or server control programmatically using the ControlCollection.Add or ControlCollection.Remove method, respectively.
DataBoundLiteralControl