Working with TextField
A TextField is a field control used to edit and display text values. Wherever you have a Title, Name or similar property, you can use a TextField.
TextField in Write mode, used in the backend form for creating News.
TextField in Read mode, used in the widget template for the News widget.
Using TextField in your static module through definitions
Whenever you are developing a static module, your persistent model is implemented as a class in C# or VB. In this case, fields are normal properties in that class. To make up the user interface of your module, we recommend using definitions. For an example of implementing those definitions, you can read Creating the backend definitions.
To use TextField in a static module, you should use the following code in the definitions of your module:
var titleField =
DataFieldName = (displayMode == FieldDisplayMode.Write) ?
DisplayMode = displayMode,
WrapperTag = HtmlTextWriterTag.Li,
In the code above, you just create a new TextFieldDefinitionElement and add it to the section. The DataFieldName property should be the name of the property in your persistent class, which will contain the value. If you are localizing all your labels for the module, you should also set the ResourceClassID property, as the example does with ProductsResources.
Using TextField for a dynamic field
You can also use TextField in a custom field that you create through the user interface. You can do that in the built-in Sitefinity modules (static and dynamic), as well as in your custom modules. When you are creating the custom field through the UI, you should specify a custom widget for entering data. The type that you need to use is Telerik.Sitefinity.Web.UI.Fields.TextField.