Databases Reference
In-Depth Information
Instead, this field template takes advantage of the fallback logic Dynamic Data uses for
types and modes.
TABLE 3.5
Example of Field Template Lookup for Integer Column
Mode=“Insert”
Mode=“Edit”
Mode=“ReadOnly
System.Int32_Insert.ascx
System.Int32_Edit.ascx
System.Int32.ascx
Int32_Insert.ascx
Int32_Edit.ascx
Int32.ascx
Integer_Insert.ascx
Integer_Edit.ascx
Integer.ascx
System.String_Insert.ascx
System.String_Edit.ascx
System.String.ascx
String_Insert.ascx
String_Edit.ascx
String.ascx
Text_Inser t.ascx
Text_Edit.ascx
Text.ascx
System.Int32_Edit.ascx
System.Int32.ascx
Int32_Edit.ascx
Int32.ascx
Integer_Edit.ascx
Integer.ascx
System.String_Edit.ascx
System.String.ascx
String_Edit.ascx
String.ascx
Text_Edit.ascx
Text.ascx
System.Int32.ascx
Int32.ascx
Integer.ascx
System.String.ascx
String.ascx
Text.ascx
In Insert mode, the
FieldTemplateFactory
starts with the most specific template name
(
System.Int32
) and mode (Insert). It tries
System.Int32_Insert
,
Int32_Insert
, and
Integer_Insert
before falling back to the next type—
String
. It continues trying
System.String_Insert
,
String_Insert
, and
Text_Insert
before falling back to the next
mode, Edit, and repeating the steps starting with the most specific template name,
System.Int32
. Eventually, it finds
Integer_Edit.ascx
, the built-in field template provided
by Dynamic Data for integer columns.
NOTE
For the UnitsInStock column, Dynamic Data uses both type aliases during the lookup
sequence—
Integer
, which represents
Int32
, and
Text
, which represents
String
.
The Edit mode lookup sequence for the UnitsInStock column is very similar to that of
Insert mode's. It starts with
System.Int32_Edit
and finds the built-in
Integer_Edit
template. The Read-only mode is different, however. Because Dynamic Data doesn't
provide a built-in read-only template for integer columns, the
FieldTemplateFactory
falls
back from
Integer
to
String
data type and eventually finds
Text.ascx
, a read-only
template that can display field values of all types.