Language preference:

Phase 3 / Field Templates included with BLD

BLD has numerous Field Templates, including some created for Telerik RadControls and with the Ajax Control Toolkit. Explore them below.

Those with the "_Edit" extension are used in edit and insert modes. You could have a separate Field Template for insert mode by using the "_Insert" extension. BLD has a powerful selection system to handle where you don't have a Field Template that matches the situation. You can override that system by using the FieldTemplate.config file to specify alternative mapping.

<%Control Language="C#" AutoEventWireup="true" Inherits="PeterBlum.DES.BLD.AnniversaryStaticFieldTemplate" %>
<script runat="server">
/* DataTypes supported: DateTime Column metadata: DESDA.AnniversaryDataTypeAttribute Usage: DateTime showing only month and day. Documentation section: "All Date, DateTime, MonthYear, and Anniversary Field Templates" * CUSTOMIZING THIS FIELD TEMPLATE: * 1. DateTimeFieldTemplateProperties is recommended for the TemplateProperties and FieldTemplateProperties * collections of BLDDataField, BLDPatternForDataField, DataFieldInPattern, and BLDCustomizer objects. * When using the Customizer to define page-level properties, * use the AnyFieldTemplateProperties class for those shared with other types of Field Templates. * * To assign properties, see "Setting public properties on the Field Template" in the Dynamic Data User's Guide. * * 2. Available properties include: DateFormat, AllowMonthNames. * * 3. The Label supports the Named Style "FieldTemplateDataControl". * * EXAMPLE: * <des:BLDDataField id="id" runat="server" DataField="FieldName" UIHint="Anniversary" > * <TemplateProperties> * <des:DateTimeFieldTemplateProperties DateFormat="Long" /> * </TemplateProperties> * <NamedStyle> * <des:NamedStyle Name="FieldTemplateDataControl" CssClass="MyClass" Style="width:100px;color:#e9e9e9;"/> * </NamedStyle> * </des:BLDDataField> */ protected void Page_Init(object sender, EventArgs e) { SetUpStaticDataControl(FieldValueLabel); }
</script> <asp:Label ID="FieldValueLabel" runat="server" EnableViewState="false" />

In the next topic, you will learn about DataBound controls, which are where Field Templates must be inserted.