WebControl::Height Property
Gets or sets the height of the Web server control.
Assembly: System.Web (in System.Web.dll)
| Exception | Condition |
|---|---|
| ArgumentException | The height was set to a negative value. |
Use the Height property to specify the height of the Web server control.
Note: |
|---|
This property does not render for all controls in browsers earlier than Microsoft Internet Explorer version 4. Controls that do not render this property in earlier browsers include Label, HyperLink, LinkButton, and any validation controls. The CheckBoxList, RadioButtonList and DataList also do not render this property in earlier browsers when their RepeatLayout property is set to RepeatLayout.Flow. Furthermore, only unit types of Pixel and Percentage are supported in earlier browsers. |
Because this property is nonstandard HTML, Web server controls that display as a table, such as Table and DataGrid, do not support this property in browsers earlier than Microsoft Internet Explorer version 4.
Note: |
|---|
To set the Height property to a unit type other than the default of Pixel, you must create a new unit type specific to the unit type you want. For example, to set a control's Height property to a percentage value of 100, you could do the following: myWebControl.Width = Unit.Percentage(100); For more information on the unit types available for the Height property, see the Unit class. |
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Note: