Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

LiteralControl Constructor

Initializes a new instance of the LiteralControl class that contains a literal string to be rendered on the requested ASP.NET page.

Namespace:  System.Web.UI
Assembly:  System.Web (in System.Web.dll)

public LiteralControl()

The following code example creates a class, CustLiteralControlClass, that extends the LiteralControl class. It creates an instance of the class named myLiteralControlClass1 by using the constructor that does not specify the text of the LiteralControl object. After the object is created, the Text property is used to set the text that it contains.

CustomLiteralControlClass myLiteralControlClass1= 
               new CustomLiteralControlClass();
myLiteralControlClass1.Text="This Control demonstrates the constructor1";

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1
© 2015 Microsoft