HtmlHead.StyleSheet Propiedad

Definición

Obtiene una instancia IStyleSheet que representa las reglas de estilo del control HtmlHead.

public:
 property System::Web::UI::IStyleSheet ^ StyleSheet { System::Web::UI::IStyleSheet ^ get(); };
public System.Web.UI.IStyleSheet StyleSheet { get; }
member this.StyleSheet : System.Web.UI.IStyleSheet
Public ReadOnly Property StyleSheet As IStyleSheet

Valor de propiedad

Un objeto que representa las reglas de estilo del control HtmlHead.

Ejemplos

En el ejemplo siguiente se muestra cómo agregar mediante programación una regla de estilo incrustada para el elemento HTML body . Este ejemplo forma parte de un ejemplo más grande proporcionado para la HtmlHead clase .

// Add the style rule named bodyStyle to the header 
// of the current page. The rule is for the body HTML element.
Page.Header.StyleSheet.CreateStyleRule(bodyStyle, null, "body");
' Add the style rule named bodyStyle to the header 
' of the current page. The rule is for the body HTML element.
Page.Header.StyleSheet.CreateStyleRule(bodyStyle, Nothing, "body")

Comentarios

La StyleSheet propiedad devuelve un IStyleSheet objeto que representa las reglas de estilo incrustadas en el HtmlHead control .

Nota:

No se admite la adición de estilos o reglas de estilo mediante programación durante los postbacks asincrónicos. Al agregar funcionalidades de AJAX a una página web de ASP.NET, los postbacks asincrónicos actualizan las regiones de la página sin actualizar toda la página. Para obtener más información, consulte Microsoft Información general de Ajax.

Se aplica a

Consulte también