Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
If a Web server control property's data type is a primitive type, such as a String, Boolean, 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.
Assign the value as a literal or variable, as in the following example:
Label1.Text = "Hello" Datagrid1.PageSize = 5
Label1.Text = "Hello"; DataGrid1.PageSize = 5;
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:
'Uses TextBoxMode enumeration TextBox1.TextMode = TextBoxMode.SingleLine 'Uses ImageAlign enumeration Image1.ImageAlign = ImageAlign.Middle
// Uses TextBoxMode enumeration TextBox1.TextMode = TextBoxMode.SingleLine; // Uses ImageAlign enumeration Image1.ImageAlign = ImageAlign.Middle;