Record Tag

Purpose

The Record code generation tag groups multiple FieldValue code generation tags so that the code is optimized.  The Record tag creates a RecordControl Presentation Layer control tag.  The Presentation Layer control tag specifies the selection criteria (query) used to select the record from the database.  If there is no enclosing Record tag, each FieldValue will be created with its own enclosing RecordControl Presentation Layer control tag.

The Record tag, used in conjunction with FieldValue tags, displays multiple fields from the same database record.

FieldValue tags are often grouped within an enclosing Record tag as shown below.  The Record tag groups together FieldValue tags that fetch and display data from the same physical record.  This is the most convenient way to optimize the code because a single SQL query is created for the Record and associated FieldValue tags.  If there is no enclosing Record tag, each FieldValue will be created as a separate control with its own SQL query.  You can specify the selection criteria used to select the record in the Query Wizard.

<GEN:Record Name=“Customer”>

     <td><GEN:FieldValue Name="FirstName"/></td>

     <td><GEN:FieldValue Name="LastName"/></td>

     <td><GEN:FieldValue Name="Address"/></td>

     <td><GEN:FieldValue Name="City"/></td>

     <td><GEN:FieldValue Name="State"/></td>

     <td><GEN:FieldValue Name="ZipCode"/></td>

     <td><GEN:FieldValue Name="Country"/></td>

     <td><GEN:FieldValue Name="PhoneNumber"/></td>

</GEN:Record>

You may wonder as to the difference between using FieldValue tags enclosed within a surrounding Record tag and just using plain FieldValue tags without a surrounding Record tag.  There are several benefits to using a surrounding Record tag:

  1. The enclosed FieldValue components will all use the same record.  When FieldValue tags are used separately without an enclosing Record tag, there is no guarantee that each FieldValue will use the same underlying database record.  It is possible for each of them to display data from a different database record, making it impossible to synchronize the display of related fields.  Using an enclosing Record tag solves this problem.

  2. Component configuration is simplified.  You can set the Record tag’s “Database field” property to the appropriate database table, saving effort when configuring the enclosed FieldValue tags.

HTML use inside Record tags

There are no restrictions on the HTML included within an enclosing Record tag.  HTML and other code generation tags can be intermingled with the FieldValue tags within an enclosing Record tag, as shown in the following example.

<GEN:Record Name=“Customer”>

     <B>Bill To:</B><br>

     <GEN:FieldValue Name="FirstName"/> <GEN:FieldValue Name="LastName"/><br>

     <GEN:FieldValue Name="Address"/><br>

     <GEN:FieldValue Name="City"/>, <GEN:FieldValue Name="State"/>

     <GEN:FieldValue Name="ZipCode"/><br>

     <GEN:FieldValue Name="Country"/><br>

     Phone: <GEN:FieldValue Name="PhoneNumber"/><br>

     FAX: <GEN:FieldValue Name="FAX"/><br>

</GEN:Record>

After configuring the components and building the application, the following page is displayed.

FieldValue tags within an enclosing Record tag ensure that each field displayed is from the same record.  Any HTML and other code generation tags may be included within an enclosing Record tag.

Examples

<GEN:Record Name=“OrderRecord”>

     <GEN:FieldValue Name=“OrderNumber”/>

     <GEN:FieldValue Name=“OrderDate”>

     <GEN:FieldValue Name=“CustomerName”/>

</GEN:Record>

[Application Generation] properties (Iron Speed Designer)

These properties control specific types of controls created by Iron Speed Designer.

Property

Description

Enter key button ID

EnterKeyCaptureToButton

ID of the button to execute when the ‘Enter’ key is pressed.

SQL query

The SQL query used to retrieve panel data.

URL

The name of the primary key parameter passed in the URL and used to fetch a record for display.  The URL property is used in Record controls on Edit Record pages.

Applies To

Record controls

ASP.NET Properties

See ASP.NET Control Properties for details.

See Also

Code Generation Tags

Code Generation Tag Properties