System.Web.UI.WebControls.Unit.Percentage Method

Creates a System.Web.UI.WebControls.Unit of type UnitType.Percentage from the specified double-precision floating-point number.

Syntax

public static Unit Percentage (double n)

Parameters

n
A double-precision floating-point number that represents the length of the System.Web.UI.WebControls.Unit.

Returns

A System.Web.UI.WebControls.Unit of type UnitType.Percentage that represents the length specified by the double-precision floating-point number.

Remarks

Use the Unit.Percentage(double) static method to create a System.Web.UI.WebControls.Unit of type UnitType.Percentage that represents the length specified by the n parameter. For example, if you specify 80 for n and use the returned unit to set the WebControl.Height of a Web server control, the height attribute is set to 80%.

Note:

The System.Web.UI.WebControls.Unit class can represent values only between -32768 and 32767.

Requirements

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0