| |||||||||||||
WebControl.Height PropertySystem.Web.UI.WebControls Namespace WebControl Class Sets or retrieves the height of a Web control. Syntax
Property ValueA Unit object that represents the height of the control.
This property is read/write with no default value. Exceptions
RemarksThis property specifies the calculated height of the object, in pixels. For table rows and cells, this property has a range of 0 to 32750 pixels. Percentage values are based on the height of the parent object. If the value of the corresponding HTML attribute was set using a percentage, this property specifies the height in pixels represented by that percentage. The scripting property is read/write for the Image class, but read-only for other controls.
This property will render on downlevel browsers for some controls only. It will not render downlevel for Label, HyperLink, LinkButton, any validator controls, or for CheckBoxList, RadioButtonList and DataList when their RepeatLayout property is Flow. ExampleThe following example shows how to declaratively set the Height property of a Web control at design time. <asp:panel id = "myPanel" runat = "server" height=300 /> The example below shows how to programmatically set the Height property at run time, depending on user input. void Page_Load ( Object src, EventArgs e ) {
if ( !IsPostBack ) {
for ( int i=100; i<=300; i+=50 ) {
heightSelect.Items.Add ( i.ToString ( ) );
}
heightSelect.SelectedIndex = 2;
}
myTableHeight = int.Parse ( heightSelect.SelectedItem.Text );
}
See AlsoWebControl Members WebControl.Width Style Base Web Control Properties |
| ||||||||||||
Check out related books at Amazon
© 2000-2008 Rey Nuñez All rights reserved.
If you have any question, comment or suggestion
about this site, please send us a note
You can help support aspxtreme