# StyleSheet

Namespace: **Wisej.Web**

Assembly: **Wisej.Framework** (4.0.0.0)

* [Component](/api/wisej.base/general/wisej.base.component.md)
  * [Component](/api/wisej.web/general/wisej.web.component.md)
    * [StyleSheet](/api/wisej.web/extenders/wisej.web.stylesheet.md)

Adds CSS styling to controls.

{% tabs %}
{% tab title="C#" %}

```csharp
public class StyleSheet : Component, IWisejExtenderProvider, IExtenderProvider
```

{% endtab %}

{% tab title="VB.NET" %}

```visual-basic
Public Class StyleSheet
    Inherits Component
    Implements IWisejExtenderProvider, IExtenderProvider
```

{% endtab %}
{% endtabs %}

## Constructors

### ![](/files/hsR4ok3152WyAf8J2C1u) StyleSheet()

Initializes a new instance of the [StyleSheet](/api/wisej.web/extenders/wisej.web.stylesheet.md) without a specified container.

### ![](/files/hsR4ok3152WyAf8J2C1u) StyleSheet(container)

Initializes a new instance of the [StyleSheet](/api/wisej.web/extenders/wisej.web.stylesheet.md) class with a specified container.

| Name          | Type                                                                                 | Description                                                                                                                                                                                           |
| ------------- | ------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **container** | [IContainer](https://docs.microsoft.com/dotnet/api/system.componentmodel.icontainer) | An [IContainer](https://docs.microsoft.com/dotnet/api/system.componentmodel.icontainer) that represents the container of the [StyleSheet](/api/wisej.web/extenders/wisej.web.stylesheet.md) extender. |

## Properties

### ![](/files/hsR4ok3152WyAf8J2C1u) Styles

[String](https://docs.microsoft.com/dotnet/api/system.string): Returns or sets the CSS definitions managed by the extender. (Default: `""`)

### ![](/files/hsR4ok3152WyAf8J2C1u) StyleSheetSource

[String](https://docs.microsoft.com/dotnet/api/system.string): Returns or set the source of the CSS file containing the CSS definitions managed by the extender. (Default: `""`)

### ![](/files/hsR4ok3152WyAf8J2C1u) Tag

[Object](https://docs.microsoft.com/dotnet/api/system.object): Returns or sets the object that contains programmer-supplied data associated with the [StyleSheet](/api/wisej.web/extenders/wisej.web.stylesheet.md) extender. (Default: `null`)

## Methods

### ![](/files/hsR4ok3152WyAf8J2C1u) CanExtend(target)

Returns true if the StyleSheet extender can offer an extender property to the specified target component.

| Parameter  | Type                                                          | Description                                       |
| ---------- | ------------------------------------------------------------- | ------------------------------------------------- |
| **target** | [Object](https://docs.microsoft.com/dotnet/api/system.object) | The target object to add an extender property to. |

**Returns:** [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean). true if the [StyleSheet](/api/wisej.web/extenders/wisej.web.stylesheet.md) class can offer one or more extender properties; otherwise, false.

### ![](/files/hsR4ok3152WyAf8J2C1u) Clear()

Removes all css classes.

### ![](/files/lzopMboA31bVq8UIcbT3) Dispose(disposing)

| Parameter     | Type                                                            | Description |
| ------------- | --------------------------------------------------------------- | ----------- |
| **disposing** | [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean) |             |

### ![](/files/hsR4ok3152WyAf8J2C1u) GetCssClass(control)

Retrieves the CSS class name associated with the specified control.

| Parameter   | Type                                         | Description                                                                                |
| ----------- | -------------------------------------------- | ------------------------------------------------------------------------------------------ |
| **control** | [Control](/api/wisej.web/general/control.md) | The [Control](/api/wisej.web/general/control.md) for which to retrieve the CSS class name. |

**Returns:** [String](https://docs.microsoft.com/dotnet/api/system.string). The CSS class name added to the specified control.

### ![](/files/lzopMboA31bVq8UIcbT3) OnWebRender(config)

Renders the client component.

| Parameter  | Type                                                          | Description                   |
| ---------- | ------------------------------------------------------------- | ----------------------------- |
| **config** | [Object](https://docs.microsoft.com/dotnet/api/system.object) | Dynamic configuration object. |

### ![](/files/hsR4ok3152WyAf8J2C1u) SetCssClass(control, cssClass)

Adds the CSS class name to the specified control.

| Parameter    | Type                                                          | Description                                                                    |
| ------------ | ------------------------------------------------------------- | ------------------------------------------------------------------------------ |
| **control**  | [Control](/api/wisej.web/general/control.md)                  | The [Control](/api/wisej.web/general/control.md) to add the CSS class name to. |
| **cssClass** | [String](https://docs.microsoft.com/dotnet/api/system.string) | The CSS class name to add to the control.                                      |

## Implements

| Name                                                                                      | Description                                                                                                     |
| ----------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
| [IUserData](/api/wisej.web/interfaces/wisej.web.iuserdata.md)                             | Provides access to the `UserData` and `Tag` properties associated to the component implementing this interface. |
| [IWisejComponent](/api/wisej.core/interfaces/wisej.core.iwisejcomponent.md)               | All wisej components implement this interface.                                                                  |
| [IWisejExtenderProvider](/api/wisej.core/interfaces/wisej.core.iwisejextenderprovider.md) | Defines the interface for extending properties to other components in a container.                              |
| [IWisejSerializable](/api/wisej.core/interfaces/wisej.core.iwisejserializable.md)         | Allows an object to serialize itself.                                                                           |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wisej.com/api/wisej.web/extenders/wisej.web.stylesheet.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
