Code Generation Tag Properties

Nearly every component has properties you can set in the Property Sheet.  Some properties govern how Iron Speed Designer creates specific components.  Others are ASP.NET component properties that are inserted as part of the ASP.NET components.

Properties and their values are physically stored in your application’s properties files for the specific component.

Terminology definitions

The terms Property and Attribute are used extensively in the .NET documentation, but are not clearly defined in an easy to find place.  Here are the definitions:

A server control's Properties are the things listed as Properties in the .NET documentation for the control class.  Properties can be set declaratively in the server control's tag by specifying an attribute name/value pair within the control's start tag.  Any attribute name / value pair within the control's start tag with a name that doesn't match one of the control's properties is an Attribute, and is "passed through" into the control's Attributes collection.  Most controls render their Attributes inside the HTML tag rendered by the control.

For example, Button controls have a CausesValidation property, but not an OnClick property.  However, either "CausesValidation=True" or "OnClick='javascript:...'" will cause the button to render an HTML tag with an OnClick attribute.  (Note that in the previous example, setting both CausesValidation=True and OnClick will cause a conflict.)  Also note that certain controls, like Literal, do not allow Attributes; they only allow Properties.

Setting ASP.NET control properties

Every code generation tag is replaced during generation with one or more ASP.NET server control tags.  For example, GEN:FieldValue is replaced by different ASP.NET controls depending on the control type.  Every type of ASP.NET server control supports a different set of run-time properties.  Most, but not all, of these properties can be initialized via the Property Sheet.  The list of valid properties is determined by the server control class and its super classes and interfaces.  These ASP.NET control properties are described in the .NET documentation for each control class.  Also, the valid values for each property can depend on the control type, the property, and in some cases the values of other properties for that control instance.

Some code generation tags also produce additional ASP.NET controls.  For example, GEN:FieldValue creates zero to five validator control tags in addition to the primary control, depending on the code generation tag's properties.  Each of these non-primary tags also supports a set of run-time properties as described above.  These can also be set via the Property Sheet, but the property Name must be prefixed with the ID of the secondary tag in order to alert Iron Speed Designer that the property is for a non-primary tag rather than the primary tag.

Custom properties

You can create your own custom properties and set them directly in the Property Sheet.  Properties are not limited to just those used in controls created by Iron Speed Designer.

Custom Properties in the Property Sheet.

Property Behavior at Run-Time

Most ASP.NET controls are replaced by your web server at run-time with one or more HTML tags in the actual HTTP response sent to the client.  The type and syntax of the HTML tag(s) is determined at run-time by the control's properties and the client's browser type.  Most of these controls will "pass through" any attributes that do not correspond to one of their control properties as attributes of the HTML tag.  For example, the GEN:Label code generation tag corresponds to a Label server control.  Label server controls do not have an "OnClick" property, but if you add something like

OnClick="'alert('Hello.');"

as an attribute of the Label's tag, it will render as something like

<span id=... OnClick="alert('Hello.');" ... />

Therefore, each server control supports an additional set of properties that correspond to the HTML attributes of the HTML tags they render as during run-time.

Since most of the server control properties affect the HTML tags and/or attributes rendered by the control, it is possible for an HTML property to conflict with a server control property.  For example, if a DropDownList's AutoPostBack property equals True, it will render as an "OnChange" attribute of the HTML <select> tag rendered at run-time.  If the DropDownList also had an HTML property named "OnChange" (e.g. OnChange="return false;"), the two would conflict and problems may occur.  Therefore, the list of valid properties, the valid values of each of them, and the effect of the valid values often varies depending on the presence and values of other properties.

The presence and/or value of specific properties could, in some cases, be affected by code customization (making the attributes be ignored, have a different effect, etc.) and/or affect code customization (making certain customizations impossible, harder, or work differently).  This case is rare, though.

Examples

Example: Add Tool Tips to Controls

Example: Boldface a FieldValue Literal Tag

See also

Overriding Properties