When generating web pages, Iron Speed Designer uses the code generation tags to generate the specific databound controls. Configure these tags using their Properties dialogs. The HTML layout and the properties settings are used generate a Presentation Layer Control Tag.
Code generation tags span the range of simple to the more complex. For example, to place a simple button on a page, the web designer simply inserts this code generation tag:
<GEN:Button Name=”EditCustomer”/>
To place a more complex component, such as a text box that display a value of a field from a database table, you can use code generation tags in the layout page such as:
<GEN:FieldValue Name=”LastName” Type=”TextBox”/>
Code generation tags are based on XML. Code generation tags contain a tag prefix to differentiate them from identically named XML-based tags that may be included in your layout page files.
For example, the <BUTTON> tag in HTML must be differentiated from the BUTTON code generation tag because they mean two completely different things. To differentiate the code generation tag, we use the code generation tag prefix and specify this tag as <GEN:Button>. The Tag Prefix is also called the XML Namespace.
The tag prefix immediate follows the “<” or “</” in a tag and ends with “:”. For code generation tags, the tag prefix is “GEN”.
The basic rules of syntax for code generation tags are similar to all other XML-based markup languages:
All code generation tags must be closed.
All code generation tags must be well formed.
All code generation tag attribute values must be enclosed in double quotes.
The Name attribute is required for most of the code generation tags. The value of the tag’s Name attribute has the following restrictions:
One word with no spaces
Must begin with a letter
Must be unique within a layout page file – except in repeating layouts
Code generation tags can be specified in either of two XML formats show below:
<GEN:Button Name=”EditCustomer”/>
<GEN:Button Name=”EditCustomer>Some arbitrary text</GEN:Button>
One of the most common mistakes made by developers not familiar with XML syntax is to use the first format without the “/” just before the closing “>”.
Correct: <GEN:Button Name=”EditCustomer”/> note: tag ends with />
Incorrect: <GEN:Button Name=”EditCustomer”> note: missing / before >
The second format is still valid XML if it is followed at some later point by </GEN:Button>. Otherwise it becomes invalid because the tag is not “closed”. This is also similar to some HTML tags, such as <TABLE> which must be closed by </TABLE>.
Attributes specify additional information about a tag. Most of the time, a tag alone is not enough information to describe the correct behavior. Attributes are used to further explain or modify the behavior of the tag. Key-value pairs within a tag define all attributes. The value part of an attribute is always enclosed with double quotes. Some attributes are required while others are optional.
Example:
<GEN:Button Name=”OK” />
In the above example, Name is an attribute whose value is “OK”.
The Name attribute is a required attribute for most of the code generation tags supported by Iron Speed Designer. Each code generation tag may have additional optional or required tags.
The Type attribute is also used for some of the code generation tags. The Type attribute specifies additional details for a code generation tag.
Example:
<GEN:FieldValue Name=”LastName” Type=”TextBox” />
The optional attributes such as Type are considered hints provided by the web designers. You can override these attributes in the tag’s Properties dialog.
Several special names cannot be used in layout pages:
Page
Self