System.Web 1.0.5000.0 2.0.0.0 Gtk# is thread aware, but not thread safe; See the <link location="node:gtk-sharp/programming/threads">Gtk# Thread Programming</link> for details. System.ComponentModel.Component System.Web.UI.IStateManager System.ComponentModel.ToolboxItem("")

The class encapsulates the properties that control the appearance of a Web server control and can be applied to multiple Web server controls to provide a common appearance. You can specify the background color and font color of a control by setting the and properties, respectively. On controls that can display a border, you can control the border width, the border style, and the border color by setting the , , and properties. The size of a Web server control can also be specified by using the and properties.

Represents the style of a Web server control.

- Constructor

  Use this constructor to create and initialize a new instance of the class.

  Initializes a new instance of the class using default values.

  1.0.5000.0
  2.0.0.0
- Constructor

  Use this constructor to create and initialize a new instance of the class using the specified by the parameter.

  Initializes a new instance of the class with the specified state bag information.

  A that represents the state bag in which to store style information.
  1.0.5000.0
  2.0.0.0
- Method
  System.Void ``

  To render attributes and styles for a Web server control on the client, you typically call the and methods to insert each attribute and style individually to the output stream. To simplify the process, this method encapsulates all calls to the and methods for every attribute and style associated with the Web server control. All attributes and styles are inserted into the output stream in a single method call.

  Adds HTML attributes and styles that need to be rendered to the specified . This method is primarily used by control developers.

  A that represents the output stream to render HTML content on the client. 1.0.5000.0 2.0.0.0
- Method
  System.Void `` ``

  To render attributes and styles for a Web server control on the client, you typically call the and methods to insert each attribute and style individually to the output stream. To simplify the process, this method encapsulates all calls to the and methods for every attribute and style associated with the Web Server control. All attributes and styles are inserted into the output stream in a single method call. This method is typically overridden by control developers in derived classes to insert the appropriate attributes and styles to the output stream for the class.

  Adds HTML attributes and styles that need to be rendered to the specified and Web server control. This method is primarily used by control developers.

  An that represents the output stream to render HTML content on the client. A or derived object that represents the Web server control associated with the . 1.0.5000.0 2.0.0.0
- Property
  System.Drawing.Color a

  Use the property to specify the background color of the Web server control. This property is set using a object.

  This property will render only for certain controls. For example, , , , , and will render this property. It will also work for , and if their RepeatLayout property is RepeatLayout.Table, and not RepeatLayout.Flow.

  In general, only controls that render as a <table> tag can display a background color in HTML 3.2, whereas almost any control can in HTML 4.0.

  For controls that render as a <span> tag (including , all validation controls, and list controls with their RepeatLayout property set to RepeatLayout.Flow), this property will work in Microsoft Internet Explorer version 5 or later, but not for Microsoft Internet Explorer version 4.

  Gets or sets the background color of the Web server control.

  1.0.5000.0
  2.0.0.0
  System.ComponentModel.TypeConverter(typeof(System.Web.UI.WebControls.WebColorConverter))
  System.ComponentModel.NotifyParentProperty(true)
  System.ComponentModel.DefaultValue(typeof(System.Drawing.Color), "")
- Property
  System.Drawing.Color a

  Use the property to specify the border color of the Web server control. This property is set using a object.

  This property will render only for certain controls. For example, , , , , and will render this property. It will also work for , , and if their RepeatLayout property is RepeatLayout.Table and not RepeatLayout.Flow. However, it is rendered as the bordercolor attribute, which may not work in all browsers.

  Gets or sets the border color of the Web server control.

  1.0.5000.0
  2.0.0.0
  System.ComponentModel.TypeConverter(typeof(System.Web.UI.WebControls.WebColorConverter))
  System.ComponentModel.NotifyParentProperty(true)
  System.ComponentModel.DefaultValue(typeof(System.Drawing.Color), "")
- Property
  System.Web.UI.WebControls.BorderStyle To be added: an object of type 'BorderStyle'

  Use the property to specify the border style for the Web server control. This property is set using one of the enumeration values. The following table lists the possible values.

  Border Style

  Description

  NotSet

  The border style is not set.

  None

  No border

  Dotted

  A dotted line border.

  Dashed

  A dashed line border.

  Solid

  A solid line border.

  Double

  A solid double line border.

  Groove

  A grooved border for a sunken border appearance.

  Ridge

  A ridged border for a raised border appearance.

  Inset

  An inset border for a sunken control appearance.

  Outset

  An outset border for a raised control appearance.

  This property will not render on some browsers.

  Gets or sets the border style of the Web server control.

  1.0.5000.0
  2.0.0.0
  System.ComponentModel.NotifyParentProperty(true)
  System.ComponentModel.DefaultValue(System.Web.UI.WebControls.BorderStyle.NotSet)
- Property
  System.Web.UI.WebControls.Unit To be added: an object of type 'Unit'

  Use the property to specify a border width for a control.

  This property does not work with all Web server controls. It only applies to controls that display as a table, such as and .

  This property is set with a object. If the property of the contains a negative number, an exception is thrown.

  The border width can only be expressed in pixels for browsers earlier than Microsoft Internet Explorer version 5. All unit types are supported in Microsoft Internet Explorer version 5 and later. Refer to the specific control for details.

  Gets or sets the border width of the Web server control.

  1.0.5000.0
  2.0.0.0
  System.ComponentModel.NotifyParentProperty(true)
  System.ComponentModel.DefaultValue(typeof(System.Web.UI.WebControls.Unit), "")
- Method
  System.Void ``

  Use the method to duplicate the style properties of the specified into the instance of the class that this method is called from.

  When a style is registered using , and then copied using , only the property is copied to the destination, not all the individual properties. This could lead to unexpected results if you then copy or examine the properties of the destination style. For example, if you are using to copy font information from the property of a that is registered, you will not get the individual settings of the font from the style.

  All properties, including those that have been set in the current instance of the class, will be replaced by the associated property in the specified by the parameter.

  Duplicates the style properties of the specified into the instance of the class that this method is called from.

  A that represents the style to copy. 1.0.5000.0 2.0.0.0
- Property
  System.String To be added: an object of type 'string'

  Use the property to specify the CSS class to render on the client for the Web server control. This property will render on browsers for all controls. It will always be rendered as the class attribute, regardless of the browser.

  For example, suppose you have the following Web server control declaration:

  `<asp:TextBox id="TextBox1" ForeColor="Red" CssClass="class1" />`

  The following HTML is rendered on the client for the previous Web server control declaration:

  `<input type=text class="class1" style="ForeColor:red">`

  On browsers that do not support CSS, setting the property will have no effect.

  Gets or sets the cascading style sheet (CSS) class rendered by the Web server control on the client.

  1.0.5000.0
  2.0.0.0
  System.ComponentModel.NotifyParentProperty(true)
  System.ComponentModel.DefaultValue("")
- Method
  2.0.0.0
  System.Void `` ``

  Use the method to add the style properties of an object to the specified object. The object that you specify must implement . All classes derived from implement .

  Adds the specified object's style properties to a object.

  The object to which to add the style properties. A -implemented object that contains the context information for the current location (URL).
- Property
  System.Web.UI.WebControls.FontInfo To be added: an object of type 'FontInfo'

  Use the property to specify the font properties of the Web server control. This property includes subproperties that can be accessed declaratively in the form of (for example Font-Bold) or programmatically in the form of (for example Font.Bold).

  All but one subproperty will render in browsers prior to Microsoft Internet Explorer version 4 for all controls. They are: , , , , , , and (but only named font sizes, such as Small, Smaller, and so on, will work).

  Although these subproperties render in browsers prior to Microsoft Internet Explorer version 4, the HTML that is rendered is different than in later browsers. Instead of rendering as style attributes, these subproperties are rendered as HTML elements, such as <b> and <font>.

  One subproperty that will not render on some browsers is .

  Gets the font properties associated with the Web server control.

  1.0.5000.0
  2.0.0.0
  System.ComponentModel.NotifyParentProperty(true)
  System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Content)
- Property
  System.Drawing.Color a

  Use the property to specify the foreground color of the Web server control. The foreground color is usually the color of the text. This property will render on browsers earlier than Microsoft Internet Explorer version 4 for all controls, except the , , and .

  On browsers that do not support styles, this property is rendered as a FONT element.

  Gets or sets the foreground color (typically the color of the text) of the Web server control.

  1.0.5000.0
  2.0.0.0
  System.ComponentModel.TypeConverter(typeof(System.Web.UI.WebControls.WebColorConverter))
  System.ComponentModel.NotifyParentProperty(true)
  System.ComponentModel.DefaultValue(typeof(System.Drawing.Color), "")
- Method
  2.0.0.0
  System.Web.UI.CssStyleCollection `` To be added.

  Use the method to retrieve the object for a specified -implemented object. All classes derived from implement .

  Retrieves the object for the specified -implemented object.

  A object.

- Property
  System.Web.UI.WebControls.Unit To be added: an object of type 'Unit'

  Use the property to specify or determine the height of the Web server control. This property is set with a .

  Gets or sets the height of the Web server control.

  1.0.5000.0
  2.0.0.0
  System.ComponentModel.NotifyParentProperty(true)
  System.ComponentModel.DefaultValue(typeof(System.Web.UI.WebControls.Unit), "")
- Property
  1.0.5000.0
  2.0.0.0
  System.Boolean To be added. To be added.

  A protected property. Gets a value indicating whether any style elements have been defined in the state bag.

  System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)
  System.ComponentModel.Browsable(false)
- Property
  System.Boolean To be added: an object of type 'bool'

  Use the property to determine whether any style elements have been defined in the state bag. This property is primarily used by control developers.

  Returns a value indicating whether any style elements have been defined in the state bag.

  1.0.5000.0
  2.0.0.0
- Method
  1.0.5000.0
  2.0.0.0
  System.Void `` To be added.

  Loads the previously saved state.

  The previously saved state.
- Method
  System.Void ``

  Use the method to combine the style properties of the specified with the instance of the class that this method is called from.

  All properties, except those that have already been set on the current instance of the Style class, will be replaced by the corresponding property of the specified by the parameter.

  Combines the style properties of the specified with the instance of the class that this method is called from.

  A that represents the style to combine. 1.0.5000.0 2.0.0.0
- Property
  2.0.0.0
  System.ComponentModel.Browsable(false)
  System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)
  System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)
  System.String To be added.

  Use the property to retrieve the CSS class that is registered with the control.

  A style is registered on the current page with a method, which looks for a <head runat="server" > element on the page where the properties in the current instance are placed in an embedded style sheet, represented by a <style> element, under a class name unique to the associated control.

  Gets the cascading style sheet (CSS) class that is registered with the control.

- Method
  System.Void

  Use this method to remove any defined style elements from the state bag.

  Removes any defined style elements from the state bag.

  1.0.5000.0
  2.0.0.0
- Method
  1.0.5000.0
  2.0.0.0
  System.Object To be added.

  A protected method. Saves any state that has been modified after the method was invoked.

  An object that represents the saved state. The default is null.

- Method
  1.0.5000.0
  2.0.0.0
  System.Void `` To be added.

  A protected internal method. Sets an internal bitmask field that indicates the style properties that are stored in the state bag.

  A bitmask value.
- Method
  2.0.0.0
  System.Void

  The method is called directly by the method of a , to mark a object so that its state is recorded in view state.

  Marks the so that its state will be recorded in view state.

- Property
  1.0.5000.0
  2.0.0.0
  System.Boolean To be added.

  This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface.

  Gets a value that indicates whether a server control is tracking its view state changes.

- Method
  1.0.5000.0
  2.0.0.0
  System.Void ``

  This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface.

  Loads the previously saved state.

  The previously saved state.
- Method
  1.0.5000.0
  2.0.0.0
  System.Object

  This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface.

  Returns the object containing state changes.

  An object that represents the saved state. The default is null.

- Method
  1.0.5000.0
  2.0.0.0
  System.Void

  This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface.

  Starts tracking state changes.

- Method
  System.String To be added

  Returns a string that represents the current object.

  A string that represents the current object.

  1.0.5000.0
- Method
  1.0.5000.0
  2.0.0.0
  System.Void To be added.

  A protected method. Marks the beginning for tracking state changes on the control. Any changes made after tracking has begun will be tracked and saved as part of the control view state.

- Property
  1.0.5000.0
  2.0.0.0
  System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)
  System.ComponentModel.Browsable(false)
  System.Web.UI.StateBag To be added.

  The private field name for the state bag is case sensitive.

  Gets the state bag that holds the style elements.

- Property
  System.Web.UI.WebControls.Unit To be added: an object of type 'Unit'

  Use the property to specify or determine the width of the Web server control. This property is set with a .

  Gets or sets the width of the Web server control.

  1.0.5000.0
  2.0.0.0
  System.ComponentModel.NotifyParentProperty(true)
  System.ComponentModel.DefaultValue(typeof(System.Web.UI.WebControls.Unit), "")