Defines the methods that a class must implement in order to support the creation of style rules.
Assembly: System.Web (in System.Web.dll)
|CreateStyleRule(Style, IUrlResolutionService, String)|
When implemented by a class, creates a style rule for the specified document language element type, or selector.
When implemented by a class, adds a new style rule to the embedded style sheet in the <head> section of a Web page.
Classes that implement this interface can use it to support the creation of style rules.
To customize the way cascading style sheets are created and registered, you must create a class that implements this interface.
Adding or modifying styles or style rules programmatically during asynchronous postbacks is not supported. When you add AJAX capabilities to an ASP.NET Web page, asynchronous postbacks update regions of the page without updating the whole page. For more information, see Microsoft Ajax Overview.
Legacy Code Example
In the first part of the example, a custom Style object, labelStyle, is created and then registered for the current location (URL). Then the label1 label calls the MergeStyle method so that the labelStyle style is applied to the label1 label.
The second part of the example defines another custom Style object, bodyStyle,and sets its properties to create a new style rule.
This class is intended primarily for developers that want to create a custom implementation. This example demonstrates the implementation provided by the .NET Framework.
The following is the code-behind file for the Web page in the preceding example.Code snippet is not found. Confirm that the code snippet name 'System.Web.UI.IStyleSheet' is correct.
Available since 2.0