Creates a System.Web.UI.WebControls.Unit of type UnitType.Percentage from the specified double-precision floating-point number.
- n
A double-precision floating-point number that represents the length of the System.Web.UI.WebControls.Unit.
![]()
A System.Web.UI.WebControls.Unit of type UnitType.Percentage that represents the length specified by the double-precision floating-point number.
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%.
The System.Web.UI.WebControls.Unit class can represent values only between -32768 and 32767.