How to: Set Web Server Control Properties Based on Simple Values or Enumerations
If a Web server control property's data type is a primitive type, such as a, , or numeric type, you can set the property value by simply assigning it to the property. Similarly, if the property's values are defined in an enumeration class, you can simply assign the enumeration to the property.
To set a property value based on simple values
Assign the value as a literal or variable, as in the following example:
To set a property value based on an enumeration
Assign the value using one of the enumeration values. ASP.NET can resolve the enumeration based on the property's type. The following code example illustrates setting a property using an enumeration: