Class ClientResourceManager
Provides the ability to request that client resources (JavaScript and CSS) be loaded on the client browser.
Inheritance
Namespace: DotNetNuke.Web.Client.ClientResourceManagement
Assembly: DotNetNuke.Web.Client.dll
Syntax
public class ClientResourceManager : object
Methods
| Improve this Doc View SourceAddConfiguration()
Adds the necessary configuration to website root web.config to use the Client Dependency component.
Declaration
public static void AddConfiguration()
ClearCache()
Clear the default composite files so that it can be generated next time.
Declaration
public static void ClearCache()
ClearFileExistsCache(String)
Clears the cache used for file existence.
Declaration
public static void ClearFileExistsCache(string path)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | path | The path for the file. |
EnableAsyncPostBackHandler()
Enables the async postback handler.
Declaration
public static void EnableAsyncPostBackHandler()
IsInstalled()
Checks if ClientDependency is installed.
Declaration
public static bool IsInstalled()
Returns
| Type | Description |
|---|---|
| System.Boolean | A value indicating whether the ClientDependency provider is installed. |
RegisterAdminStylesheet(Page, String)
Registers a stylesheet that has an admin level priority.
Declaration
public static void RegisterAdminStylesheet(Page page, string filePath)
Parameters
| Type | Name | Description |
|---|---|---|
| Page | page | The page on which to register the style. |
| System.String | filePath | The path to the CSS stylesheet. |
RegisterDefaultStylesheet(Page, String)
Registers the default.css stylesheet.
Declaration
public static void RegisterDefaultStylesheet(Page page, string filePath)
Parameters
| Type | Name | Description |
|---|---|---|
| Page | page | The page on which to register the style. |
| System.String | filePath | The path to the CSS stylesheet. |
RegisterFeatureStylesheet(Page, String)
Registers a stylesheet for a specific feature.
Declaration
public static void RegisterFeatureStylesheet(Page page, string filePath)
Parameters
| Type | Name | Description |
|---|---|---|
| Page | page | The page on which to register the style. |
| System.String | filePath | The path to the CSS stylesheet. |
RegisterIEStylesheet(Page, String)
Registers a stylesheet specific for Internet Explorer.
Declaration
public static void RegisterIEStylesheet(Page page, string filePath)
Parameters
| Type | Name | Description |
|---|---|---|
| Page | page | The page on which to register the style. |
| System.String | filePath | The path to the CSS stylesheet. |
RegisterScript(Page, String, FileOrder.Js, IDictionary<String, String>)
Requests that a JavaScript file be registered on the client browser.
Declaration
public static void RegisterScript(Page page, string filePath, FileOrder.Js priority, IDictionary<string, string> htmlAttributes)
Parameters
| Type | Name | Description |
|---|---|---|
| Page | page | The current page. Used to get a reference to the client resource loader. |
| System.String | filePath | The relative file path to the JavaScript resource. |
| FileOrder.Js | priority | The relative priority in which the file should be loaded. |
| IDictionary<System.String, System.String> | htmlAttributes | A dictionary of HTML attributes to use for the |
RegisterScript(Page, String, FileOrder.Js, String, IDictionary<String, String>)
Requests that a JavaScript file be registered on the client browser.
Declaration
public static void RegisterScript(Page page, string filePath, FileOrder.Js priority, string provider, IDictionary<string, string> htmlAttributes)
Parameters
| Type | Name | Description |
|---|---|---|
| Page | page | The current page. Used to get a reference to the client resource loader. |
| System.String | filePath | The relative file path to the JavaScript resource. |
| FileOrder.Js | priority | The relative priority in which the file should be loaded. |
| System.String | provider | The name of the provider responsible for rendering the script output. |
| IDictionary<System.String, System.String> | htmlAttributes | A dictionary of HTML attributes to use for the |
RegisterScript(Page, String, FileOrder.Js, String)
Requests that a JavaScript file be registered on the client browser.
Declaration
public static void RegisterScript(Page page, string filePath, FileOrder.Js priority, string provider)
Parameters
| Type | Name | Description |
|---|---|---|
| Page | page | The current page. Used to get a reference to the client resource loader. |
| System.String | filePath | The relative file path to the JavaScript resource. |
| FileOrder.Js | priority | The relative priority in which the file should be loaded. |
| System.String | provider | The name of the provider responsible for rendering the script output. |
RegisterScript(Page, String, FileOrder.Js)
Requests that a JavaScript file be registered on the client browser.
Declaration
public static void RegisterScript(Page page, string filePath, FileOrder.Js priority)
Parameters
| Type | Name | Description |
|---|---|---|
| Page | page | The current page. Used to get a reference to the client resource loader. |
| System.String | filePath | The relative file path to the JavaScript resource. |
| FileOrder.Js | priority | The relative priority in which the file should be loaded. |
RegisterScript(Page, String, IDictionary<String, String>)
Requests that a JavaScript file be registered on the client browser.
Declaration
public static void RegisterScript(Page page, string filePath, IDictionary<string, string> htmlAttributes)
Parameters
| Type | Name | Description |
|---|---|---|
| Page | page | The current page. Used to get a reference to the client resource loader. |
| System.String | filePath | The relative file path to the JavaScript resource. |
| IDictionary<System.String, System.String> | htmlAttributes | A dictionary of HTML attributes to use for the |
RegisterScript(Page, String, Int32, IDictionary<String, String>)
Requests that a JavaScript file be registered on the client browser.
Declaration
public static void RegisterScript(Page page, string filePath, int priority, IDictionary<string, string> htmlAttributes)
Parameters
| Type | Name | Description |
|---|---|---|
| Page | page | The current page. Used to get a reference to the client resource loader. |
| System.String | filePath | The relative file path to the JavaScript resource. |
| System.Int32 | priority | The relative priority in which the file should be loaded. |
| IDictionary<System.String, System.String> | htmlAttributes | A dictionary of HTML attributes to use for the |
RegisterScript(Page, String, Int32, String, IDictionary<String, String>)
Requests that a JavaScript file be registered on the client browser.
Declaration
public static void RegisterScript(Page page, string filePath, int priority, string provider, IDictionary<string, string> htmlAttributes)
Parameters
| Type | Name | Description |
|---|---|---|
| Page | page | The current page. Used to get a reference to the client resource loader. |
| System.String | filePath | The relative file path to the JavaScript resource. |
| System.Int32 | priority | The relative priority in which the file should be loaded. |
| System.String | provider | The name of the provider responsible for rendering the script output. |
| IDictionary<System.String, System.String> | htmlAttributes | A dictionary of HTML attributes to use for the |
RegisterScript(Page, String, Int32, String, String, String, IDictionary<String, String>)
Requests that a JavaScript file be registered on the client browser.
Declaration
public static void RegisterScript(Page page, string filePath, int priority, string provider, string name, string version, IDictionary<string, string> htmlAttributes)
Parameters
| Type | Name | Description |
|---|---|---|
| Page | page | The current page. Used to get a reference to the client resource loader. |
| System.String | filePath | The relative file path to the JavaScript resource. |
| System.Int32 | priority | The relative priority in which the file should be loaded. |
| System.String | provider | The name of the provider responsible for rendering the script output. |
| System.String | name | Name of framework like Bootstrap, Angular, etc. |
| System.String | version | Version number of framework. |
| IDictionary<System.String, System.String> | htmlAttributes | A dictionary of HTML attributes to use for the |
RegisterScript(Page, String, Int32, String, String, String)
Requests that a JavaScript file be registered on the client browser.
Declaration
public static void RegisterScript(Page page, string filePath, int priority, string provider, string name, string version)
Parameters
| Type | Name | Description |
|---|---|---|
| Page | page | The current page. Used to get a reference to the client resource loader. |
| System.String | filePath | The relative file path to the JavaScript resource. |
| System.Int32 | priority | The relative priority in which the file should be loaded. |
| System.String | provider | The name of the provider responsible for rendering the script output. |
| System.String | name | Name of framework like Bootstrap, Angular, etc. |
| System.String | version | Version number of framework. |
RegisterScript(Page, String, Int32, String)
Requests that a JavaScript file be registered on the client browser.
Declaration
public static void RegisterScript(Page page, string filePath, int priority, string provider)
Parameters
| Type | Name | Description |
|---|---|---|
| Page | page | The current page. Used to get a reference to the client resource loader. |
| System.String | filePath | The relative file path to the JavaScript resource. |
| System.Int32 | priority | The relative priority in which the file should be loaded. |
| System.String | provider | The name of the provider responsible for rendering the script output. |
RegisterScript(Page, String, Int32)
Requests that a JavaScript file be registered on the client browser.
Declaration
public static void RegisterScript(Page page, string filePath, int priority)
Parameters
| Type | Name | Description |
|---|---|---|
| Page | page | The current page. Used to get a reference to the client resource loader. |
| System.String | filePath | The relative file path to the JavaScript resource. |
| System.Int32 | priority | The relative priority in which the file should be loaded. |
RegisterScript(Page, String)
Requests that a JavaScript file be registered on the client browser.
Declaration
public static void RegisterScript(Page page, string filePath)
Parameters
| Type | Name | Description |
|---|---|---|
| Page | page | The current page. Used to get a reference to the client resource loader. |
| System.String | filePath | The relative file path to the JavaScript resource. |
RegisterStyleSheet(Page, String, FileOrder.Css, IDictionary<String, String>)
Requests that a CSS file be registered on the client browser. Defaults to rendering in the page header.
Declaration
public static void RegisterStyleSheet(Page page, string filePath, FileOrder.Css priority, IDictionary<string, string> htmlAttributes)
Parameters
| Type | Name | Description |
|---|---|---|
| Page | page | The current page. Used to get a reference to the client resource loader. |
| System.String | filePath | The relative file path to the CSS resource. |
| FileOrder.Css | priority | The relative priority in which the file should be loaded. |
| IDictionary<System.String, System.String> | htmlAttributes | A dictionary of HTML attributes to use for the |
RegisterStyleSheet(Page, String, FileOrder.Css)
Requests that a CSS file be registered on the client browser. Defaults to rendering in the page header.
Declaration
public static void RegisterStyleSheet(Page page, string filePath, FileOrder.Css priority)
Parameters
| Type | Name | Description |
|---|---|---|
| Page | page | The current page. Used to get a reference to the client resource loader. |
| System.String | filePath | The relative file path to the CSS resource. |
| FileOrder.Css | priority | The relative priority in which the file should be loaded. |
RegisterStyleSheet(Page, String, IDictionary<String, String>)
Requests that a CSS file be registered on the client browser.
Declaration
public static void RegisterStyleSheet(Page page, string filePath, IDictionary<string, string> htmlAttributes)
Parameters
| Type | Name | Description |
|---|---|---|
| Page | page | The current page. Used to get a reference to the client resource loader. |
| System.String | filePath | The relative file path to the CSS resource. |
| IDictionary<System.String, System.String> | htmlAttributes | A dictionary of HTML attributes to use for the |
RegisterStyleSheet(Page, String, Int32, IDictionary<String, String>)
Requests that a CSS file be registered on the client browser. Defaults to rendering in the page header.
Declaration
public static void RegisterStyleSheet(Page page, string filePath, int priority, IDictionary<string, string> htmlAttributes)
Parameters
| Type | Name | Description |
|---|---|---|
| Page | page | The current page. Used to get a reference to the client resource loader. |
| System.String | filePath | The relative file path to the CSS resource. |
| System.Int32 | priority | The relative priority in which the file should be loaded. |
| IDictionary<System.String, System.String> | htmlAttributes | A dictionary of HTML attributes to use for the |
RegisterStyleSheet(Page, String, Int32, String, IDictionary<String, String>)
Requests that a CSS file be registered on the client browser. Allows for overriding the default provider.
Declaration
public static void RegisterStyleSheet(Page page, string filePath, int priority, string provider, IDictionary<string, string> htmlAttributes)
Parameters
| Type | Name | Description |
|---|---|---|
| Page | page | The current page. Used to get a reference to the client resource loader. |
| System.String | filePath | The relative file path to the CSS resource. |
| System.Int32 | priority | The relative priority in which the file should be loaded. |
| System.String | provider | The provider name to be used to render the css file on the page. |
| IDictionary<System.String, System.String> | htmlAttributes | A dictionary of HTML attributes to use for the |
RegisterStyleSheet(Page, String, Int32, String, String, String, IDictionary<String, String>)
Requests that a CSS file be registered on the client browser. Allows for overriding the default provider.
Declaration
public static void RegisterStyleSheet(Page page, string filePath, int priority, string provider, string name, string version, IDictionary<string, string> htmlAttributes)
Parameters
| Type | Name | Description |
|---|---|---|
| Page | page | The current page. Used to get a reference to the client resource loader. |
| System.String | filePath | The relative file path to the CSS resource. |
| System.Int32 | priority | The relative priority in which the file should be loaded. |
| System.String | provider | The provider name to be used to render the css file on the page. |
| System.String | name | Name of framework like Bootstrap, Angular, etc. |
| System.String | version | Version number of framework. |
| IDictionary<System.String, System.String> | htmlAttributes | A dictionary of HTML attributes to use for the |
RegisterStyleSheet(Page, String, Int32, String, String, String)
Requests that a CSS file be registered on the client browser. Allows for overriding the default provider.
Declaration
public static void RegisterStyleSheet(Page page, string filePath, int priority, string provider, string name, string version)
Parameters
| Type | Name | Description |
|---|---|---|
| Page | page | The current page. Used to get a reference to the client resource loader. |
| System.String | filePath | The relative file path to the CSS resource. |
| System.Int32 | priority | The relative priority in which the file should be loaded. |
| System.String | provider | The provider name to be used to render the css file on the page. |
| System.String | name | Name of framework like Bootstrap, Angular, etc. |
| System.String | version | Version number of framework. |
RegisterStyleSheet(Page, String, Int32, String)
Requests that a CSS file be registered on the client browser. Allows for overriding the default provider.
Declaration
public static void RegisterStyleSheet(Page page, string filePath, int priority, string provider)
Parameters
| Type | Name | Description |
|---|---|---|
| Page | page | The current page. Used to get a reference to the client resource loader. |
| System.String | filePath | The relative file path to the CSS resource. |
| System.Int32 | priority | The relative priority in which the file should be loaded. |
| System.String | provider | The provider name to be used to render the css file on the page. |
RegisterStyleSheet(Page, String, Int32)
Requests that a CSS file be registered on the client browser. Defaults to rendering in the page header.
Declaration
public static void RegisterStyleSheet(Page page, string filePath, int priority)
Parameters
| Type | Name | Description |
|---|---|---|
| Page | page | The current page. Used to get a reference to the client resource loader. |
| System.String | filePath | The relative file path to the CSS resource. |
| System.Int32 | priority | The relative priority in which the file should be loaded. |
RegisterStyleSheet(Page, String)
Requests that a CSS file be registered on the client browser.
Declaration
public static void RegisterStyleSheet(Page page, string filePath)
Parameters
| Type | Name | Description |
|---|---|---|
| Page | page | The current page. Used to get a reference to the client resource loader. |
| System.String | filePath | The relative file path to the CSS resource. |
UpdateVersion()
This is a utility method that can be called to update the version of the composite files.
Declaration
public static void UpdateVersion()