.NET Framework Class Library Menu..::.IncludeStyleBlock Property Gets or sets a value that indicates whether ASP.NET should render a block of cascading style sheet (CSS) definitions for the styles that are used in the menu.
Namespace:
System.Web.UI.WebControls
Assembly:
System.Web (in System.Web.dll)

Syntax
Public Property IncludeStyleBlock As Boolean
Get
Set
public bool IncludeStyleBlock { get; set; }
public:
property bool IncludeStyleBlock {
bool get ();
void set (bool value);
}
member IncludeStyleBlock : bool with get, set
<asp:Menu IncludeStyleBlock="True|False" />
Property ValueType: System..::.BooleanA value that indicates whether ASP.NET should render a block of CSS definitions for the styles that are used in the menu. The default value is true.

Remarks
The Menu control uses CSS styles to control its appearance in a browser. By default, it renders a style element that contains the CSS definitions for the CSS classes that it uses. You typically set this property to false in the following situations: You want to provide your own CSS definitions in order to customize the appearance of the menu. You must then provide your own block of CSS definitions in the page, or include a link to an external CSS file that contains the definitions. You want to keep the default appearance but prefer to keep the generated CSS definitions in a separate file. You must then provide the file and link to it.
In either of these situations, you can get a copy of the default CSS block that the Menu control generates by setting the property to true, running the page, and viewing the page in a browser. You can then view the page source in the browser and copy and paste the CSS block into the page markup or into a separate file. If you set this property to false, you cannot set style properties. For example, you cannot add a DynamicHoverStyle-ForeColor attribute in markup or set the DynamicHoverStyle.ForeColor property in code.

Version Information
.NET FrameworkSupported in: 4

Platforms
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role not supported), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

See Also
|
Bibliothèque de classes .NET Framework Menu..::.IncludeStyleBlock, propriété Obtient ou définit une valeur qui indique si ASP.NET doit restituer un bloc de définitions de feuille de style en cascade (CSS) pour les styles utilisés dans le menu.
Espace de noms :
System.Web.UI.WebControls
Assembly :
System.Web (dans System.Web.dll)

Syntaxe
Public Property IncludeStyleBlock As Boolean
Get
Set
public bool IncludeStyleBlock { get; set; }
public:
property bool IncludeStyleBlock {
bool get ();
void set (bool value);
}
member IncludeStyleBlock : bool with get, set
<asp:Menu IncludeStyleBlock="True|False" />
Valeur de propriétéType : System..::.BooleanValeur qui indique si ASP.NET doit restituer un bloc de définitions CSS pour les styles utilisés dans le menu. La valeur par défaut est true.

Notes
Le contrôle Menu utilise des styles CSS pour contrôler son apparence dans un navigateur. Par défaut, il restitue un élément style qui contient les définitions CSS pour les classes CSS qu'il utilise. Vous affectez en général à cette propriété la valeur false dans les situations suivantes : Vous voulez fournir vos propres définitions CSS pour personnaliser l'apparence du menu. Vous devez fournir ensuite votre propre bloc de définitions CSS dans la page ou inclure un lien vers un fichier CSS externe qui contient les définitions. Vous voulez garder l'apparence par défaut mais préférez conserver les définitions CSS générées dans un autre fichier. Vous devez ensuite fournir le fichier et créer une liaison.
Dans l'une ou l'autre de ces situations, vous pouvez obtenir une copie du bloc CSS par défaut que le contrôle Menu génère en affectant à la propriété la valeur true, en exécutant la page et en affichant la page dans un navigateur. Vous pouvez consulter ensuite la source de la page dans le navigateur et copier et coller le bloc CSS dans le balisage de la page ou dans un autre fichier. Si vous affectez à cette propriété la valeur false, vous ne pouvez pas définir de propriétés de style. Par exemple, vous ne pouvez pas ajouter d'attribut DynamicHoverStyle-ForeColor dans le balisage ou définir la propriété DynamicHoverStyle.ForeColor dans le code.

Informations de version
.NET FrameworkPris en charge dans : 4

Plateformes
Windows 7, Windows Vista SP1 ou ultérieur, Windows XP SP3, Windows Server 2008 (installation minimale non prise en charge), Windows Server 2008 R2 (installation minimale prise en charge avec SP1 ou version ultérieure), Windows Server 2003 SP2
Le .NET Framework ne prend pas en charge toutes les versions de chaque plateforme. Pour obtenir la liste des versions prises en charge, consultez Configuration requise du .NET Framework.

Voir aussi
|